Part IV Chapter 18

What it means

Contents
  1. For an evaluator
  2. For a designer
  3. For an attacker
  4. What all of it depends on

Part 3 built a method on a chip whose answers were known, and the last three chapters ran it on chips whose answers mostly weren’t. Here is what came out, side by side:

ESHARDCHES_CTFASCADr
chip and measurement32-bit ARM, electromagnetic32-bit ARM, power8-bit AVR, electromagnetic
labelHamming weightHamming weightwhole byte
what the network learns, and whenhigh or low, at epoch 4high or low by epoch 40; even or odd at epochs 77 to 85bits 0 and 1 of the S-box input at epochs 7 to 13; of its output at 13 to 22
masks read from the networkweights 47% and 50% exact, checked against the published masksweights about 92% exact, checked with paritynot read
where the readings leakwhere the published shares leakmask first, in fifteen places; masked share laterno readings

Three chips, two kinds of measurement, two processor sizes, and the same story underneath. The network learns in steps. Each step is a way of combining the two shares of a masked value that the network could not use one at a time. And when a step happens, the first layer sharpens the shares that step needs, and only those. On the two chips that leak Hamming weights, the shares sit on two directions of the first layer, clean enough to read back out with nothing but the labels.

This is a weak kind of universality: the same structures, because the same masking meets the same kind of leakage. It isn’t a law, and ASCADr shows how quickly the details change it.

For an evaluator

A certification lab gets a chip and a deadline, and often reports one number: how many traces an attack needs. That number says how much a chip leaks, not where or why. Reading the shares out of a network that breaks the chip turns a black-box result into a map. On CHES_CTF, a dataset published without masks, the signal-to-noise ratio of the two readings shows the mask leaking in six separate stretches of the trace before the masked S-box output appears. A designer can do something with that: each of those places is an operation that touches the mask, and each is a candidate to fix.

The jumps say when to look. Chapters 12 to 14 say what to look at: the logits, then the layer, then a patch that tests what the layer holds. None of it needs the masks, which is what makes it usable on a chip whose internals the lab can’t see.

For a designer

The structures in Part 3 come from an algebraic accident. With Boolean masking, HW(m) + HW(s) always has the parity of HW(m ⊕ s), and the same holds for any number of shares. So a chip that leaks Hamming weights hands the network a rule it can learn in two easy steps: high or low from the two weights, then parity once it reads them exactly. The paper suggests masking schemes that don’t fit Hamming weights so neatly, such as masking in a prime field, where shares add up modulo a prime instead of being XORed (Faust et al., Eurocrypt 2024 (opens in a new tab)). Whether that stops a network from learning, or only slows it down, is a question for experiments, not for this part.

Noise is the other lever. On ESHARD the shares leak with a signal-to-noise ratio under 0.4; on CHES_CTF even the readings, which are only estimates of the true shares, reach 2.9 and 6.4. ESHARD’s network never takes the second step, and Chapter 15 found why that fits: its first layer doesn’t hold the weights sharply enough for parity to be worth learning. It still recovers the key, with 633 traces at epoch 100 against 14 for CHES_CTF at epoch 200. The noise didn’t make the chip safe; it seems to have kept the network at the easy step.

For an attacker

The paper’s argument is that one broken byte can help with the rest. Masked AES implementations often reuse masks across bytes: in ASCAD’s, the S-box lookups of all 16 bytes share one input mask and one output mask, r_in and r_out, which is why its metadata hold 18 mask bytes rather than 16. An attacker who breaks the easiest byte and reads its masks out of the network could then train on the other bytes with those masks known, as if the chip weren’t masked.

Two things temper that here. What the method reads is the Hamming weight of a mask, not the mask, and it reads it exactly on about half to 92% of traces, not all of them. And it needs a network that already breaks a byte. Reading the masks is a way to understand an attack that works, not a way to make one that doesn’t.

What all of it depends on

Every step so far leaned on things this guide knew in advance, and a careful reader should keep the list:

  • A network that works. Without a key-recovering network there is nothing to interpret.
  • A leakage model. The plane was chosen by fitting the table of Chapter 12, which assumes two shares leaking their Hamming weights. ASCADr leaks bits, and the method stopped there.
  • Profiling on a device the attacker controls. All three networks trained on traces with known keys.
  • The architecture. These are multilayer perceptrons. The paper’s CNN for ASCADr learns the same bits, more gradually, and hides them in less convenient components.
  • Orientation. The labels can’t tell a reading from its mirror, 8 − w. On ESHARD only the published masks settled it.
  • Reproducibility of the published artifacts. The published ASCADr checkpoints learn the paper’s features but don’t reproduce the information the paper reports.

And every step was done by hand: the jumps found by looking at curves, the epochs chosen by eye, the planes searched with a table written for one leakage model, on datasets someone else recorded. Part 5 asks whether that can change. Chapter 19 starts with the first step: finding the jumps without looking.