PUF Away for Hardware Fingerprinting [Hackaday]

View Article on Hackaday

Despite the rigorous process controls for factories, anyone who has worked on hardware can tell you that parts may look identical but are not the same. Everything from silicon defects to microscopic variations in materials can cause profoundly head-scratching effects. Perhaps one particular unit heats up faster or locks up when executing a specific sequence of instructions and we throw our hands up, saying it’s just a fact of life. But what if instead of rejecting differences that fall outside a narrow range, we could exploit those tiny differences?

This is where physically unclonable functions (PUF) come in. A PUF is a bit of hardware that returns a value given an input, but each bit of hardware has different results despite being the same design. This often relies on silicon microstructure imperfections. Even physically uncapping the device and inspecting it, it would be incredibly difficult to reproduce the same imperfections exactly. PUFs should be like the ideal version of a fingerprint: unique and unforgeable.

Because they depend on manufacturing artifacts, there is a certain unpredictability, and deciding just what features to look at is crucial. The PUF needs to be deterministic and produce the same value for a given specific input. This means that temperature, age, power supply fluctuations, and radiation all cause variations and need to be hardened against. Several techniques such as voting, error correction, or fuzzy extraction are used but each comes with trade-offs regarding power and space requirements. Many of the fluctuations such as aging and temperature are linear or well-understood and can be easily compensated for.

Broadly speaking, there are two types of PUFs: weak and strong. Weak offers only a few responses and are focused on key generation. The key is then fed into more traditional cryptography, which means it needs to produce exactly the same output every time. Strong PUFs have exponential Challenge-Response Pairs and are used for authenticating. While strong PUFs still have some error-correcting they might be queried fifty times and it has to pass at least 95% of the queries to be considered authenticated, allowing for some error.

Transistor-based SRAM circuit diagram
Transistor SRAM from Vijayakumar et al. Which transistors win on startup depends on process variation.

There are dozens of types of PUFs ranging from simple metal vias to quantum optical systems. One of the more common techniques for implementing a PUF is on top of SRAM. A traditional six-transistor SRAM cell settles on a random value between 0 and 1 when it first starts up due to process variations between the six transistors that make it up. Another transistor can be added to give it precharge/discharge capabilities because turning on and off the SRAM cell to take another measurement can be inefficient.

While this all sounds interesting, how does it affect you? While it’s still a titanic-sized task to dope your own silicon and etch your own ASIC,  it’s becoming easier than ever to get your own silicon via OpenPDKs. Many FPGAs such as the Xilinx Zynq have PUFs built-in. Since many PUFs are built on top of SRAM, it’s possible to bring them to most FPGAs as this Github repo demonstrates. Even an Arduino can use an SRAM module as a PUF. Since the ESP32 comes with SRAM onboard and the SDK allows you to carve out sections that won’t be touched by the bootloader, so there’s another PUF you can play with.

Of course, PUFs aren’t a magic security measure. Given enough time alone with a device, a hacker could extract all the challenge-response pairs even from a strong PUF, and look it up from the dictionary when challenged. Machine learning attacks can be particularly effective as they can learn and exploit any sort of correlation present in the responses. Side-channel attacks such as power usage can be applied thanks to the error-correction and other post-processing techniques, exposing important details.

Optical PUFs can protect against some of these attacks. It shines a light into some complex scattering medium such as a glittery varnish or metallic paint and sends a response back. But even this is still vulnerable to the emulation problem. Using a quantum readout solves this by making it harder to know what the challenge is. By sending a single photon and reading the coherent scattering, only the challenger knows what the challenge and the response are. The attacker cannot read the challenge without modifying or destroying it. While this has been demonstrated in a lab, quantum PUFs are still not a commercial reality.

For now, PUFs exist in your SIM cards, IP cameras, RFID tags, RISC-V IoT devices, and thousands of other devices you interact with. Next time you need to reach for that unique chip identifier, now you might know a little more about where it’s coming from.