Physical Side Channels
Side-Channel Attacks · Advanced Exploitation track
8 min read
In this module
When the Hardware Talks
Every computation is a physical process. Transistors switch, current flows, electromagnetic fields wobble. None of those are accidents — they carry information about the data being processed. Physical side-channel attacks exploit that fact by measuring the physical properties of a device while it does its sensitive work.
Cache and speculative execution attacks chew on microarchitectural state from software. Physical side channels are different. They want proximity, or outright physical access. The targets that matter most: embedded systems, smart cards, hardware security modules (HSMs), cryptocurrency hardware wallets, and IoT devices. Anywhere an attacker might end up holding the box in their hand.
Power Analysis
Every time a transistor flips from 0 to 1 (or back), it draws a tiny pulse of current to charge or discharge the gate capacitance. Add up every switching transistor across a chip and you've got the total current draw at that instant. Different operations on different data produce different switching patterns, which means different power consumption profiles.
Simple Power Analysis (SPA) stares at the power trace (a graph of power use over time) and looks for shapes the eye can pick out. In an RSA square-and-multiply implementation:
- A squaring operation has a distinct power signature
- A multiply operation looks different
- The sequence of squares and multiplies spells out the secret key: each bit gets a square, and only the 1 bits get a multiply after it
Power trace during RSA (square-and-multiply, key bits left to right): _/‾‾\_/‾‾\_/‾‾‾‾‾‾\_/‾‾\_/‾‾\_/‾‾\_/‾‾‾‾‾‾\_/‾‾\_/‾‾‾‾‾‾\_ SQ SQ MUL SQ SQ SQ MUL SQ MUL [ 0 ][ 1 ][ 0 ][ 0 ][ 1 ][ 1 ] Every bit costs a square; a 1 bit adds a multiply. SQ alone = 0, SQ then MUL = 1 Key bits: 0 1 0 0 1 1SPA works when the power difference between operations is fat enough to spot by eye. It bites hardest against implementations that branch through different code paths depending on key bits.
Simple Power Analysis directly examines the power consumption trace of a device to identify operations being performed. Different operations produce visually distinct patterns in the power trace. SPA can reveal secret key bits when the implementation uses different code paths or instruction sequences depending on key values.
Differential Power Analysis (DPA) is the heavier weapon. Rather than reading the overall shape of the trace, DPA pulls out statistical correlations between tiny power variations and specific data values. It works even when the differences are submerged in noise — invisible to the naked eye.
The DPA attack against AES rolls like this:
- Collect thousands of power traces while the device encrypts different known plaintexts with the same key.
- Pick one byte of the key and hypothesise its value (256 possibilities per byte).
- For each hypothesis, compute what the intermediate value would be at a specific point in the AES computation — say, just after the first SubBytes.
- Split the traces into two groups depending on whether a specific bit of that intermediate value is 0 or 1.
- Average the power traces inside each group, then subtract one mean from the other.
- If the key guess is right, the difference trace shows a sharp spike at the moment that intermediate value was computed — because the bit value correlates with power. If the guess is wrong, the difference looks like flat noise.
For each key byte hypothesis k (0 to 255): Compute intermediate = SubBytes(plaintext_byte XOR k) Split traces by bit 0 of intermediate Group 0: traces where bit 0 = 0 Group 1: traces where bit 0 = 1 Difference = mean(Group 1) - mean(Group 0)
Correct k: difference shows a clear peakWrong k: difference is flat noiseDPA typically needs a few hundred to a few thousand traces to recover an AES-128 key. The trick is divide and conquer: each of the 16 key bytes is attacked on its own, so the attacker tests 16 × 256 = 4,096 hypotheses (about 2^12) against the same set of traces, instead of searching 2^128 keys in one go.
Electromagnetic Analysis
Electromagnetic emanation attacks share the same conceptual core as power analysis, except the attacker reads the electromagnetic field around the device rather than its power draw. Current flowing through the chip's internal wires generates that field.
EM has two advantages over power analysis:
- No physical connection: No need to tap the power supply. An antenna held close to the chip is enough.
- Spatial resolution: A small, focused EM probe lets the attacker zero in on emissions from specific parts of the chip, isolating the crypto computation from everything else and trimming the noise.
Researchers have lifted cryptographic keys by parking an EM probe next to:
- Smart cards and credit cards
- Laptop CPUs (from across the table)
- Smartphones (through the case)
- Hardware security modules
The SPA and DPA toolbox carries straight over to EM traces. Same physics: current flow creates magnetic fields that carry the same information about the data.
Fault Injection
Fault injection (also called glitching) is the active cousin of these attacks. The attacker deliberately causes computation errors at precise moments. Power and EM analysis are passive observations; fault injection reaches in and pokes the device until it misbehaves.
Common fault injection techniques:
Voltage glitching: Drop or spike the supply voltage for an instant and logic gates malfunction for a clock cycle or two. The CPU might skip an instruction, compute the wrong result, or load garbage from memory.
Clock glitching: Briefly shrink a clock cycle so the CPU samples data before it has settled. The result is precise, repeatable errors that can target individual instructions.
Laser fault injection: A focused laser shone at specific transistors on a decapped chip flips individual bits. Surgical levels of spatial and temporal control.
Electromagnetic fault injection (EMFI): A brief, intense EM pulse from a coil parked near the chip induces enough current to scramble the computation. Coarser than laser, but you don't have to crack the chip open.
Fault injection deliberately causes hardware to malfunction at specific moments during sensitive computations. Techniques include voltage glitches, clock manipulation, focused lasers, and electromagnetic pulses. The induced faults can bypass security checks, corrupt computations to leak key material, or skip critical instructions entirely.
Fault Attack Applications
Fault injection has a handful of pay-offs:
Bypassing security checks: If a boot ROM verifies a digital signature before running firmware, a single glitch that flips the comparison from "not equal" to "equal" walks right through the entire secure boot chain. The Nintendo Switch was famously broken via Fusee Gelee — though Fusee Gelee itself was a USB buffer overflow in the Tegra X1 boot ROM's recovery mode (RCM), not a glitch attack. Plenty of other consoles have fallen to actual voltage glitching.
The diagram traces an illustrative boot ROM check, instruction by instruction. The attacker triggers on some observable event (a GPIO toggle, a dip in the power trace), counts cycles to the conditional branch, and fires the glitch there. If the branch is skipped, execution falls straight through to the boot path with the signature check still failed.
Differential Fault Analysis (DFA): Force a computation error in a specific round of AES and compare the faulty ciphertext to the correct one. The difference leaks the round key. A single correct/faulty pair can shrink the search space dramatically; two or three pairs are usually enough to recover the full key.
AES encryption with fault in round 8: Correct ciphertext: C Faulty ciphertext: C' Difference reveals information about the round 9 and 10 keys → Full key recovery with 2-3 fault pairsPrivilege escalation: Glitching a CPU while it's in the middle of a security-sensitive transition (entering secure world on ARM TrustZone, or moving in or out of an Intel SGX enclave) can quietly skip the check and hand the attacker access to protected resources.
Defences Against Physical Side Channels
Physical side-channel defences matter for any hardware that handles secrets where an attacker might physically reach it:
Masking (for power/EM): Split every secret into random shares that are processed independently. The power profile of each share is random and uncorrelated with the actual secret. The secret only reappears once the shares are recombined. First-order masking uses two shares; higher-order masking uses more for stronger protection.
Shuffling: Randomise the order of operations. If AES processes its 16 state bytes in a different order each run, the attacker can't align power traces to do DPA.
Constant-power circuits: Design logic gates that consume the same power no matter the data. This kills the power channel at the hardware level. The price is higher chip area and noticeably more power overall.
Glitch detectors: Circuits that watch supply voltage and clock frequency for anomalies and reset the device if something looks off.
Redundancy: Perform the computation twice (or in two different ways) and compare. A successful fault injection will diverge the results, and the device can refuse to emit anything.
Physical shielding: Wrap sensitive chips in active mesh shields that detect probing. Tamper-evident enclosures that zeroise secrets the moment they're opened.
Physical side-channel attacks live in a totally different threat model from software bugs. They demand hardware expertise and specialised gear. The pay-off is that they can break cryptographic implementations which are mathematically perfect and bug-free. For security-critical hardware, defending against physical side channels is the price of admission.