DL·SYS
Contact ↗

CSCTF 2026 · Crypto · 270 pts

Emanation.

A masked AES implementation defeats first-order CPA — but the mask's own leakage, multiplied against the data it's hiding, gives the key away anyway.

Side-channelSecond-order CPAAES-CTR
EventCSCTF 2026, Operation Dawn (online jeopardy)
CategoryCrypto
Points270
StatusSolved during the event
Targettrace set, offline

TL;DR. Each power trace has a large trigger spike at a randomized delay; after aligning every trace on that spike, first-order CPA against the Hamming weight of `sbox[plaintext XOR key]` finds nothing — the implementation is masked. Second-order CPA, correlating the product of the mask's own leakage point against each data leakage point, recovers every key byte cleanly.

Challenge

Recover the AES-128 key protecting a sealed order, from a set of masked power traces.

Solution

Each trace has a large trigger spike (power around 25) at a delay of 0–16 samples that varies trace to trace; aligning every trace on that spike first is necessary before any further analysis lines up correctly. After alignment, 17 leakage points of interest sit at odd sample offsets from 3 to 35.

Running standard first-order CPA (Hamming weight of sbox[plaintext_byte XOR key_guess] against each sample) finds nothing — exactly what's expected if the implementation masks its intermediate values, since masking makes any single sample's leakage statistically independent of the real data.

Second-order CPA breaks the mask: multiplying the leakage at the mask's own sample (index 0) against the leakage at each data point (j+1), then correlating that product against the same Hamming-weight model, gives one clear winning key-byte guess per position — correlations around 0.21–0.26 against at most 0.08 for the second-best guess, with the byte order unshuffled.

The recovered key, 52cc11fc4a2ecfc066e3349f4af9fdea, decrypts the sealed order under AES-128-CTR with an all-zero counter block, giving the flag.

Flag

FlagCSCTF{relay_order_55a10bd8f06393bcc1ae8065}

What I took from it