Week 3 - Scan Attacks

2026-02-10  |  Lecture , Cryptography , Scan Chain , Side Channel

Download the lecture slides for this week here: COMP6420_2026T1_Week3_Scan_Attacks.pdf

COMP6420 Week 3 – Scan Attacks


1. Recap: why we build crypto hardware in the first place

Why is cryptography often implemented in custom hardware?

It can accelerate crypto operations and can help protect secrets (e.g., keeping round keys in ROM or otherwise off the “normal” software-visible pathway). Common deployment examples include smart/chip credit cards and TV/satellite decoders, and most modern CPUs have dedicated crypto acceleration instructions (e.g., AES-NI, ARMv8 crypto extensions, and RISC-V crypto extensions).

However, the same hardware features that make chips testable and maintainable can undermine crypto secrecy if exposed.


2. Why testing exists

Integrated circuits require systematic testing to:

Traditional testing approaches include:

This motivates a more powerful approach: design-for-test (DFT) infrastructure that makes internal state observable/controllable.


3. DFT basics: scan chains as a test backdoor

Digital circuits are a mix of registers (state) and combinational logic (functions), and the test challenge is: how do we efficiently test internal state and internal wires, not just primary inputs/outputs?

3.1 The scan chain idea

A scan chain is a DFT technique that effectively turns many internal flip-flops into a long shift register, so you can:

Scan is extremely widely deployed (slides cite “~80% of ICs”), heavily supported by industrial EDA DFT flows, and conceptually similar infrastructure exists in FPGAs for configuration readback/debug.


4. The security conflict: scan vs cryptographic design principles

Once scan gives broad internal visibility, there is a direct conflict with cryptography’s “don’t leak internals” mindset. Crypto guidance (as framed in the slides) includes:

This is tied back to Kerckhoffs’ principle: attackers may know the algorithm and design, but must not learn the key—scan can break that assumption if it reveals key-dependent internal state.


5. Scan attacks: the high-level attacker workflow

Scan attacks are a two-part problem:

Step 1: Get access to the scan chain

Options include:

Step 2: Use scan to leak secrets

Two major styles:


6. Concrete example: scan attacks on AES (high-level)

Case study: Breaking AES via scan chain in practice.

6.1 Threat model

The attacker typically knows:

6.2 Two-step attack on AES

  1. Identify the scan chain structure:
    The core trick is to reset the chip, apply controlled plaintext differences (often 1-bit or 1-byte changes), run for a minimal number of cycles, then scan out and look for which bits in the scan stream change consistently. This allows you to map portions of the scan stream to meaningful internal registers (input/output, control, AES state/round register).

  2. Extract round key material (especially RK0):
    Once you can reliably scan out the AES state after a controlled partial execution, you can set up equations relating plaintext, scanned state, and unknown key bytes. We look at Yang et al.’s approach where carefully chosen plaintext pairs produce constraints that narrow each key byte to two possibilities, and then a small brute-force search over the remaining ambiguity becomes feasible (e.g., reducing the search from 2^128 to something like 2^16 after “pairwise” narrowing).

Big-picture: scan access can collapse a multi-round cipher into something closer to a “single-round” problem, because the attacker can directly observe intermediate state that should never be exposed.

Scan-style attacks exist for public-key schemes (RSA, ECC) and get more complex in modern SoCs with scan compression/compaction, but the fundamental issue remains.


7. Countermeasures: making DFT less dangerous (trade-offs everywhere)

DFT is valuable and widely used, so defenses must preserve testability while reducing leakage.

7.1 Unbound scan chains

One extreme is leaving scan chains “unbound” (not connected in a convenient way), which can improve security but hurts maintenance and in-field debug.

7.2 Test locks

Another common idea is locking/unlocking test mode. The slides note this can be brute-forced or bypassed depending on implementation and threat model.

7.3 “Secure Scan” (mirror key approach)

The lecture presents Secure Scan (Yang, Wu, Karri) as a more crypto-aware DFT architecture:

Physical attacks on scan control signals are a risk, and propose integrity checking and buffering as part of hardening.

No defense is “perfect”; rather, it increases attacker cost (time, expertise, equipment) even if full design knowledge is assumed.

7.4 Scramble the scan chain

A different line of defense is scan chain scrambling:

The slides include an example cost figure (for a ~3K flip-flop design) with overhead around ~12%, reflecting that security features tend to cost area/complexity.

7.5 Flipped scan

Another lightweight method is “flipped scan,” inserting inverters on a random subset of scan inputs:

7.6 Overall trade-off statement

Secure DFT usually requires modifications to:

and inevitably involves trade-offs between security, power/area overhead, and testability.


8. Week 3 assessment focus (what you’re expected to do)

The Week 3 lab is Lab 1: Scan Attack on AES. Each student is given a unique AES core (with variations like randomized key and randomized scan chain order), and the task is to perform the scan attack to extract key material and derive the secret key. The required hand-in includes your discovered scan chain layout and the extracted/derived key information. The due date is Friday of Week 4.


Appendix: DES scan attack mechanics

There is also an appendix that walks through DES scan attack mechanics for your own reference.