Tech In Plain Sight: Field Guide To Power Plugs

It is the bane of worldwide travel: there isn’t just one way to get AC power from the wall. The exact connector — and what you can expect when you plug in — differs from country to country. Even if you stay home, you must account for this if your designs go places and expect to plug into the wall. If you’ve ever looked at a universal adapter, it is full of prongs and pins like a metallic porcupine. Where do all those pins go?

Of course, there are some easy ways to sidestep the whole issue if you don’t need AC power. Much low-power gear now just provides a USB or barrel connector. Then you can use an area-appropriate adapter or charger to power your device. Batteries work, too. But if you need to plug in, you will run into other kinds of plugs.

Switching power supplies have helped. In the old days, many things expected either 125V or 250V and didn’t work with the opposite voltage. Switching power supplies often allow a wide input range or have a switch to select one range or the other. These two voltages will cover almost any situation. If you have something that must have one voltage or the other, you’ll need a transformer — also called a converter — to step the voltage up or down. But most often, these days, you just need an adapter. There are slight variations. For example, some countries supply 100V or 110V, but that usually doesn’t make much difference. You also need to understand if your equipment cares if the AC is 50 Hz or 60 Hz.

Most of the power sockets you’ll find around the world will fall into one of several categories. The categories range from A to N. Even among these, however, there are variations.

Type A

For example, the common type A plug and socket are what Americans call “two prong.” If you live in the US, you’ve probably noticed that the plug is polarized. That is, one pin is slightly wider than the other so the plug can only go in one way. The wide pin is connected to the circuit neutral. The maximum load for this connector is 15A. It is difficult to find type A sockets anymore, other than on cheap extension cords or things like lamps that pass through their electrical connections to a second socket. Type B is far more common and type A plug will fit in a type B socket.

Continue reading “Tech In Plain Sight: Field Guide To Power Plugs”

All About USB-C: Connector Mechanics

There’s two cases when hackers have to think about USB-C connector mechanics. The first is when a USB-C connector physically breaks, and the second is when we need to put a connector on our own board. Let’s go through both of them.

Clean That Connector

What if a socket on your phone or laptop fails? First off, it could be due to dust or debris. There’s swabs you can buy to clean a USB-C connector; perhaps adding some isopropyl alcohol or other cleaning-suitable liquids, you can get to a “good enough” state. You can also reflow pins on your connector, equipped with hot air or a sharp soldering iron tip, as well as some flux – when it comes to mechanical failures, this tends to remedy them, even for a short period of time.

How could a connector fail, exactly? Well, one of the pins could break off inside the plastic, or just get too dirty to make contact. Consider a device with a USB-C charging and data socket, with USB 2.0 but without high-speed pairs – which is to say, sadly, the majority of the phones out there. Try plugging it into a USB-A charger using a USB-A to USB-C cable. Does it charge, even if slowly? Then, your VBUS pins are okay.

Plug it into a Type-C charger using a Type-C cable, and now the CC pins are involved. Does it charge in both orientations? Then both of your CC pins are okay. Does it charge in only one orientation? One of the CC pins has to be busted. Then, you can check USB 2.0 pins, used for data transfer and legacy charging. Plug the phone into a computer using a USB-A to USB-C cable. Does it enumerate as a device? Does it enumerate in both orientations? If not, you might want to clean D- and D+ pins specifically, maybe even both sets. Continue reading “All About USB-C: Connector Mechanics”

Diagram of Packets Sent by Timeshifter

Encoding Data In Packet Delays

If you’ve ever been to a capture the flag hacking competition (CTF), you’ve probably seen some steganography challenges. Steganography is the art of concealing data in plain sight. Tools including secret inks that are only visible under certain light have been used for this purpose in the past. A modern steganography challenge will typically require you to find a “flag” hidden within an image or file.

[Anfractuosus] came up with a method of hiding packets within a stream of network traffic. ‘Timeshifter’ encodes data as delays between packets. Depending on the length of the delay, each packet is interpreted as a one or zero.

To do this, a C program uses libnetfilter_queue to get access to packets. The user sets up a network rule using iptables, which forwards traffic to the Timeshifter program. This is then used to send and receive data.

All the code is provided, and it makes for a good example if you’ve ever wanted to play around with low-level networking on Linux. If you’re interested in steganography, or CTFs in general, check out this great resource.