$ ./sidechannel.exe --target aes --model hw
correlation power analysis
Recover the key
A chip is encrypting with a secret key. Every time it computes SBOX[plaintext ^ key] it burns slightly more power for every set bit, and that leaks. Steal the key before the session closes.
- 01captureTraces are limited. Each one makes the correlation a little sharper.
- 02read the chartOne of the 256 candidates is the real key byte. It rises out of the noise as traces accumulate; the tallest bar is your answer.
- 03commitClick the bar that stands clear of the rest. Guess wrong and you lose traces and seconds.
- 04repeat, harderFour bytes, each noisier than the last. Whatever you do not spend carries into the next byte, so a fast first byte funds the fourth.
choose a difficulty
score = seconds left × 10 + traces left when the key is out, shown out of 100 for the level. Unspent traces carry into the next byte. A lock is safe once the leading bar is ~0.12 of correlation clear of the rest; earlier is a gamble, later is wasted budget and clock.
The attack is real: a genuine AES S-box, a Hamming-weight leakage model and Pearson correlation across all 256 guesses. Only the device and its noise are simulated. On real hardware this is done with a ChipWhisperer, which is what the hardware security lab covers.