Skip to content

Commit 734e7e3

Browse files
committed
fix: correct three-spike explanation
All three correlation spikes are SubBytes pipeline stages, not one AddRoundKey + two SubBytes as previously stated.
1 parent d25fe29 commit 734e7e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • picoctf/crypto/PowerAnalysis: Part 1

picoctf/crypto/PowerAnalysis: Part 1/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Challenge description: This embedded system allows you to measure the power consumption of the CPU while it is running an AES encryption algorithm. Use this information to leak the key via dynamic power analysis.
66

7-
The challenge exposes a server that encrypts arbitrary 16-byte plaintexts with a fixed unknown AES-128 key and returns a power trace — a sequence of ~2666 power measurements sampled during the encryption. By collecting many traces with random plaintexts and applying a **Correlation Power Analysis (CPA)** attack targeting the first SubBytes operation, the 16-byte key can be recovered one byte at a time.
7+
The challenge exposes a server that encrypts arbitrary 16-byte plaintexts with a fixed unknown AES-128 key and returns a power trace — a sequence of 2666 power measurements sampled during the encryption. By collecting many traces with random plaintexts and applying a **Correlation Power Analysis (CPA)** attack targeting the first SubBytes operation, the 16-byte key can be recovered one byte at a time.
88

99
**Artifacts:**
1010

@@ -122,7 +122,7 @@ def cpa_attack(plaintexts, traces, verbose=False):
122122

123123
### Results
124124

125-
With 300 traces the correct key byte is decisively recovered for all 16 positions. The **correlation over time** plot shows that each byte produces a cluster of three closely-spaced correlation spikes — one for the AddRoundKey bus operation, one for the SBOX table lookup landing on the data bus, and one for the result being written back to the state array. All three are functions of `HW(SBOX[pt[i] XOR key[i]])` and therefore correlated with the correct key hypothesis.
125+
With 300 traces the correct key byte is decisively recovered for all 16 positions. The **correlation over time** plot shows that each byte produces a cluster of three closely-spaced correlation spikes, all corresponding to pipeline stages of the SubBytes table lookup: the SBOX output value `SBOX[pt[i] XOR key[i]]` moves across the data bus in multiple distinct clock-cycle events — fetched from the lookup table into a register, propagated through the pipeline, and written back to the state array — each producing an independent power spike correlated with `HW(SBOX[pt[i] XOR key[i]])`.
126126

127127
![Correlation over time](plots/correlation_time.png)
128128

0 commit comments

Comments
 (0)