Chapters

20 Hardware Security: Surfaces and Side Channels

security
hardware
iot

20.1 Overview

This first route builds a defensive hardware review and follows leakage, fault, and extraction evidence.

This is part 1 of 2. Continue with Hardware Security: Trojans and Assurance for the second focused route.

20.2 Start With the Board in Someone’s Hands

A field gateway is taken down for service and placed on a workbench. The enclosure is open, the board is visible, and a technician can see pads, headers, flash memory, reset pins, and labels. The first review question is not an exploit recipe. It is a defensive inventory: which physical features could reveal secrets or change code if they were left enabled in the shipped build?

Start simple. Pick one deployed device, name the places a person can touch, then record the control and evidence for each one: debug locked or disabled, boot path verified, external memory protected, tamper assumptions stated, side-channel risk bounded, and supply-chain provenance checked. That turns “hardware security” from a vague property into a set of claims another reviewer can retest.

20.3 Overview: When the Attacker Can Touch the Device

Most software security quietly assumes the attacker is on the other side of a network. Hardware security removes that assumption. IoT devices often live in places where a person can hold, open, probe, swap, or simply steal them: a sensor on a pole, a gateway in a shared cabinet, a consumer gadget on a shelf. Once physical access is on the table, a different set of weaknesses opens up that network controls cannot close.

The guiding question for this whole chapter is defensive and simple: what could a person with physical access learn or change, and does the device have controls that limit it? We are not looking for ways to break a device. We are looking for the evidence that says it resists being broken.

That evidence should be tied to the deployment setting. A lab prototype, a home device, a field gateway, and a safety-critical controller can expose the same board features but require different production controls, acceptance tests, and retest triggers.

If you only need the intuition, this layer is enough: a hardware review starts with the physical access assumption, then checks whether debug ports, the boot path, stored secrets, and the supply chain are controlled for the place the device will actually live.

Think of two laptops holding the same secret file. One sits in a locked safe; the other is left open on a cafe table. The file is identical, but the risk is not, because the second machine can be touched. Hardware vulnerability review is the discipline of asking how much “cafe table” exposure a device has, and how much it was hardened for that reality.

A useful review of Overview: When the Attacker Can Touch the Device must preserve the sequence implied when “The hardware attack surface: debug interfaces, boot trust, external storage, key handling, side-channel leakage, tamper paths, and the supply chain” is explicit in the diagram. Figure 20.1 gives that sequence named checkpoints.

An IoT device at the center surrounded by its hardware attack surface: debug and programming interfaces, boot trust, external storage, key handling, side-channel leakage, physical tamper paths, and supply-chain assurance
Figure 20.1: The hardware attack surface: debug interfaces, boot trust, external storage, key handling, side-channel leakage, tamper paths, and the supply chain

Follow the labeled evidence in Figure 20.1: Debug establishes context, Tamper exposes the decisive step, and trace provenance shows where the result lands. That reading explains “The hardware attack surface: debug interfaces, boot trust, external storage, key handling, side-channel leakage, tamper paths, and the supply chain” is explicit in the diagram. The chapter can now use Overview: When the Attacker Can Touch the Device as an engineering criterion.

20.3.1 The Main Surfaces, in One Minute

Interfaces and boot

Debug and programming headers (JTAG, SWD, UART) and the boot path decide what code runs and what memory is reachable.

Storage and secrets

External flash and key storage decide whether firmware and credentials can be read or altered off the main processor.

Physics and supply chain

Side-channel leakage, fault injection, tamper paths, hardware Trojan risk, and component provenance decide whether physics or sourcing can bypass a control.

20.3.2 Beginner Examples

Taken together, these checks make the section reviewable. That order prevents a control name from being treated as proof and connects the visual to the chapter's evidence-led review sequence.

20.3.3 Overview Knowledge Check

If you can name the physical access assumption and the main surfaces, you have the core idea. Continue to Practitioner to run a structured, evidence-led review.

20.4 Practitioner: A Defensive Hardware Review Workflow

A hardware review is an evidence exercise, not an exploitation exercise. The aim is to identify exposure and confirm that production controls are actually applied, recorded, and tested. The workflow below stays defensive: it asks what to verify, never how to misuse a device.

20.4.1 The Review Sequence

Taken together, these checks make the section reviewable. That order prevents a control name from being treated as proof and connects the visual to the chapter's evidence-led review sequence.

The design consequence of The Review Sequence depends on the path, not just the endpoint. Figure 20.2 makes that path explicit as “The review flow: physical access assumption first, then inventory, production evidence, protected operations, supply chain, and a residual-risk decision” is explicit in the diagram.

Hardware vulnerability review flow moving from physical access assumptions through interface inventory, production configuration checks, protected operation review, supply-chain evidence, and residual-risk decisions.
Figure 20.2: The review flow: physical access assumption first, then inventory, production evidence, protected operations, supply chain, and a residual-risk decision.

The labels Inventory, sensitive ops, and accept or fix divide Figure 20.2 into responsibility, decision, and consequence. Their exact meanings support the claim that “The review flow: physical access assumption first, then inventory, production evidence, protected operations, supply chain, and a residual-risk decision” is explicit in the diagram. That support is what the The Review Sequence narrative needs before proceeding.

20.4.2 Surface, Defensive Question, and Evidence

Surface
Defensive Question
Good Evidence
Failure If Missing
Debug interface
Is debug disabled, authenticated, or removed in production?
Provisioning record showing the lock or fuse was applied.
Open path to read memory and halt the processor.
Boot chain
Is firmware verified before it runs, with rollback control?
Secure-boot config plus a rejected unsigned-image test.
Untrusted or downgraded firmware can execute.
External storage
Are off-chip firmware and secrets protected?
Encryption and integrity check on external memory.
Contents can be read or altered off the board.
Key storage
Where do long-lived keys live, and who can read them?
Secure element or protected storage, not general flash.
A firmware compromise can exfiltrate the keys.
Supply chain
Do parts and firmware match the approved design?
Provenance, hashes, and receiving acceptance tests.
Substituted or tampered parts enter unnoticed.
IC provenance
Can an inserted or modified circuit path hide in the device?
Trusted IP/CAD source records, sample tests, side-channel review, and runtime monitors for high-risk parts.
A hardware Trojan can leak, deny service, or alter outputs below the software layer.

20.4.3 Review Claims as Testable Statements

Hardware claims are easy to overstate, so phrase each as a specific statement with named evidence. “Debug is disabled in production” should point to a provisioning record and an acceptance test. “Keys are protected” should name where keys live and who can read them. If the evidence is missing, record the claim as unverified rather than assuming it from brand, price, or enclosure appearance.

20.4.4 Practitioner Knowledge Check

If you can run the workflow and demand evidence per claim, you can review a board responsibly. Continue to Under the Hood for why these surfaces leak and how the controls actually work.

20.5 Under the Hood: Why Each Surface Leaks, and What Resists It

The deeper layer explains the mechanism behind each surface, defensively. Knowing why a control exists tells you what evidence proves it is present and what residual risk remains. None of this is a recipe; it is the reasoning a reviewer needs.

20.5.1 Debug and Programming Interfaces

Interfaces such as JTAG, SWD, and a serial console exist so engineers can program, halt, single-step, and read memory during development. Those same powers, left enabled in the field, can let someone read firmware and secrets out of the chip or pause a security check. The defensive answer is to close or gate the door: permanently disable the interface, blow a one-time-programmable fuse, or require authenticated debug so that only an authorized party with a key can re-enable it. The evidence is a provisioning record proving the lock was applied to shipped units, not just available in the part.

A reliable account of Debug and Programming Interfaces must show both responsibility and outcome. Figure 20.3 links those ideas through the claim that this connected JTAG programmer makes the trust boundary tangible: the ribbon cable terminates at a physical board header whose production lock state must be proven, not assumed from the absence of a network service. Photo: Martin Guy, CC BY-SA 3.0.

An AVR JTAG ICE programmer and ribbon cable attached to a development board
Figure 20.3: This connected JTAG programmer makes the trust boundary tangible: the ribbon cable terminates at a physical board header whose production lock state must be proven, not assumed from the absence of a network service. Photo: Martin Guy, CC BY-SA 3.0

In Figure 20.3, the black AVR programmer is connected by a grey ribbon cable to the board debug header. That physical chain is the point: a tool intended for legitimate programming reaches the target below the network stack. The image therefore returns Debug and Programming Interfaces to its production question—whether that same header is disabled, authenticated, or otherwise proven inaccessible on shipped hardware.

20.5.2 Side-Channel Leakage

A processor doing secret-dependent work also does secret-dependent physics: it draws slightly different power, emits different electromagnetic patterns, or takes different amounts of time depending on the data. A side channel is the observation that those physical signals can correlate with a secret. The defensive focus is never how to measure them; it is whether sensitive operations use implementations designed to leak less, such as constant-time code that avoids data-dependent branches and timing, masking that randomizes intermediate values, or a secure element built to resist physical observation. Whether this risk is realistic depends on the device’s value and exposure.

20.5.2.1 SPA: structure visible in one trace

Simple Power Analysis reads coarse operation structure from one aligned power trace P(t)P(t). Repeated round boundaries, multiplication patterns, conditional branches, or memory transfers may create visibly different regions. Ten similar bursts in a trace can be consistent with the ten rounds of AES-128, for example, but a trace shape alone does not prove which algorithm or key was used. The defensive question is whether one observation reveals operation order, secret-dependent branches, or exceptional cases. Constant-time control flow, uniform error handling, and reduced externally visible structure address that class of leakage.

20.5.2.2 DPA: make a small dependency survive averaging

Differential Power Analysis uses many traces Pi(t)P_i(t) collected while known or chosen inputs vary. For a candidate hypothesis gg, compute a predicted one-bit property di(g)d_i(g) of an internal intermediate, split the traces by that prediction, and subtract the group means:

Δg(t)=1n1i:di(g)=1Pi(t)1n0i:di(g)=0Pi(t).\Delta_g(t)= \frac{1}{n_1}\sum_{i:d_i(g)=1}P_i(t) - \frac{1}{n_0}\sum_{i:d_i(g)=0}P_i(t).

Walk the logic rather than memorising the formula. First, time-align the same operation across traces. Second, use the hypothesis to place each trace in group 0 or group 1. Third, average within each group: unrelated noise tends toward the same mean in both groups. Fourth, subtract. If the hypothesis predicts a real data-dependent transition, a peak remains near the instant that intermediate is processed. A wrong hypothesis mixes the physical states and tends to cancel. More traces reduce random uncertainty; they do not “average away” leakage that is correlated with the partition.

SPA and DPA answer different questions from different amounts of data, and that difference is far easier to see than to describe. Before adding a continuous statistic, read the two paired panels of Figure 20.4 side by side.

Top panel: a single power trace P(t) with ten similar bursts separated by visible boundaries, bracketed as one boundary per round. Bottom panel: a four-step differential pipeline labelled collect n traces, predict one bit, average each group, subtract the means, followed by two difference plots in which the correct hypothesis keeps a peak and the wrong hypothesis cancels to noise.
Figure 20.4: One trace carries structure; many traces carry a single predicted bit.

The upper card of Figure 20.4 holds one measurement, P(t), in which ten similar bursts sit between visible boundaries. That repetition is consistent with ten cipher rounds, and the card’s own caution is the part a reviewer must keep: shape does not identify the algorithm or the key. The lower card trades that single observation for four steps — Collect n traces, Predict one bit, Average each group, Subtract the means — and then shows the result twice. Under the correct hypothesis g a time-localised peak survives the averaging; under the wrong hypothesis g the two groups cancel into the same flat noise. Those two small plots are the entire reason a defender cannot treat trace count as a safety margin.

20.5.2.3 CPA: rank a leakage model continuously

Correlation Power Analysis replaces the binary partition with a numeric leakage prediction. For each test vector xix_i and candidate subkey gg, a lab evaluator computes an expected intermediate zi(g)z_i(g) and a simple leakage model such as Hamming weight Li(g)=HW(zi(g))L_i(g)=\operatorname{HW}(z_i(g)). At each time sample tt, compare the prediction vector with the measured power vector using Pearson correlation:

ρg(t)=cov(L(g),P(t))σL(g)σP(t).\rho_g(t)= \frac{\operatorname{cov}(L(g),P(t))} {\sigma_{L(g)}\sigma_{P(t)}}.

The defensive evaluation pipeline is: capture traces under authorized test vectors; preprocess and align them; generate a predicted leakage vector for every candidate; compute ρg(t)\rho_g(t) across the trace; rank candidates by a preregistered statistic such as maxtρg(t)\max_t|\rho_g(t)|; repeat on fresh traces; and treat a stable, time-localized separation as evidence of leakage. Subkey results can combine into a wider secret, which is why a review cannot dismiss a small per-operation leak as harmless. A sound lab report also tests negative controls, multiple devices, trace-count sensitivity, and confidence margins so noise or alignment artifacts are not mistaken for recovery.

Written out as prose, that pipeline is a list of verbs. What a reviewer actually receives is a ranking, so it helps to see the shape of a positive result before judging one. Figure 20.5 draws the six steps, the ranking they produce, and the countermeasures the next section unpacks.

Upper card: six numbered CPA evaluation steps from capturing traces under authorised test vectors to repeating on fresh traces, above a bar chart of the ranking statistic in which one candidate subkey rises clearly above a dashed noise band. Lower card: four stacked countermeasure layers labelled physical, circuit and technology, algorithm and code, and protocol and system, each with the evidence it must produce.
Figure 20.5: What an authorised evaluation produces is a ranking that survives fresh traces, not a key.

In Figure 20.5 the numbered steps run from Capture traces under authorised test vectors to Repeat on fresh traces; require a stable peak, and the bar chart under them shows what a positive result looks like: one candidate standing clearly above the noise band while every other candidate stays inside it. The single tall bar is not the finding. The finding is that the same bar is still tall on a fresh capture, which is why the repetition step is not optional politeness. The lower card then puts the answer where it belongs, from 1 · PHYSICAL decoupling and shielding through to 4 · PROTOCOL AND SYSTEM query limits and key rotation, with each layer naming the evidence it owes rather than the label it carries.

20.5.2.4 Countermeasures belong at four layers

LayerExamplesWhat the evidence must show
PhysicalLocal decoupling and filtering, shielding, randomized clocking where safe, tamper responseLeakage or acquisition cost changes under the evaluated probe position, bandwidth, voltage, and temperature; filtering alone is not assumed to erase correlation.
Circuit/technologyBalanced or dual-rail styles, hardened cryptographic block, secure elementThe selected implementation and operating conditions have side-channel evaluation evidence, not only a generic product label.
Algorithm/implementationMasking of intermediates, hiding/randomized execution, constant-time code, uniform error pathsCompiler output and statistical leakage tests preserve the property across builds; masks are fresh and do not recombine into first-order leakage.
Protocol/systemLimit unauthenticated queries, rate and anomaly monitoring, key rotation, privilege separation, revocationAn exposed device cannot provide unlimited useful observations, and a suspected key can be replaced without replacing the whole fleet.

No single row is sufficient. Masking can fail if randomness is weak, filtering can leave correlated residue, and rate limits do not protect a device an attacker owns physically. The review should combine layers according to value and exposure and retain the measured residual rather than claim that “encryption” itself prevents physical leakage.

20.5.3 Fault Injection

Many security decisions reduce to a single check, for example “is this signature valid, yes or no.” Fault injection is the family of techniques that push hardware outside its safe envelope, with abnormal voltage, clock, or temperature, to make a check misbehave, such as skipping the branch that would have rejected an image. The defensive design response is to make a single glitch insufficient: verify critical decisions more than once, use robust state machines, default to fail-closed so an unexpected state denies rather than allows, and add environmental sensors where the threat model justifies it.

20.5.4 Physical Extraction and Tamper

The chapter pauses for Figure 20.6 so that Physical Extraction and Tamper has inspectable evidence. The visual’s specific claim is that this exposed secure-element die shows the physical target behind the threat model. Hardware isolation raises the cost of extracting keys, but package opening, probing, and the board-level link to the host still belong in the review. Photo: Kawe Mazidjatari, CC BY-SA 4.0.

Magnified silicon die of a secure element used in NFC-enabled devices
Figure 20.6: This exposed secure-element die shows the physical target behind the threat model. Hardware isolation raises the cost of extracting keys, but package opening, probing, and the board-level link to the host still belong in the review. Photo: Kawe Mazidjatari, CC BY-SA 4.0

Read the photograph in Figure 20.6 by locating the silicon die, the bond-pad perimeter, and the dense internal interconnect that package plastic normally hides. The magnified structures make the attack surface physical: isolation raises extraction cost, but it does not erase probing or package-opening risk. That observation connects Physical Extraction and Tamper to the required board-level controls and residual-risk record.

If secrets or firmware sit in external memory, they can be read off-board; more invasive physical attacks target the chip itself. The layered defense is to keep high-value secrets in a secure element or one-time-programmable storage rather than general flash, to encrypt and integrity-check anything stored externally, and to add tamper evidence or tamper response, such as seals, enclosure design, or automatic key erasure, when opening the device should change the trust boundary.

Programmable non-volatile memory needs the same evidence discipline. One-time-programmable cells, lock fuses, and secure key slots are useful only when the provisioning record proves which secrets or boot decisions were written, who could write them, and whether application firmware can ever rewrite them. EEPROM-style key or bootloader storage is more flexible, but that flexibility is a risk: the review should show that manufacturing key injection is authenticated, that application code cannot overwrite protected areas, and that any configuration fuse or write-protect state survives firmware updates and repair workflows.

The bus that carries this traffic is itself part of the surface. Many designs move keys, configuration, or firmware between the main processor and external memory or a secure element over a simple board-level bus such as I2C or SPI. Because these buses are typically unauthenticated and unencrypted by default, physical access to test points or exposed pads can let someone observe or inject on that link even when the memory chip itself is well chosen. The review question is not only whether the memory is protected, but whether the link to that memory is protected: evidence should show bus-level encryption or an authenticated transaction scheme, or a physical control such as shielding, potting, or trace routing that raises the cost of probing the link.

20.6 Continue to Part 2

Continue with Hardware Security: Trojans and Assurance.