./jerome{m}jack in

~/Labs/ICE Lab.md · lab · 5 min · updated

ICE Lab

2026 · Rust · WebAssembly · Cryptography · Side-Channel Physics · Blackwall Dossier

« Kuang Grade Mark Eleven penetration program… sliding through the Tessier-Ashpool ICE like warm mercury. »

Mathematically, brute-forcing a 128-bit AES key takes 2^{128} steps — billions of times the age of the universe. Yet an unshielded 8-bit hardware security module running bit-exact AES-128 can leak all sixteen key bytes in under a hundred power traces. The cipher isn't broken; the silicon is. Every clock cycle, charging CMOS transistors on an internal register bus draws a tiny spike of current proportional to the Hamming weight (number of 1 bits) or Hamming distance (number of flipped bits) of the intermediate byte passing through the S-Box.

The ICE Lab is a self-contained synthetic CMOS hardware side-channel and countermeasures workbench compiled from zero-dependency Rust to 49 KB of WebAssembly (ice.wasm) — running real NIST FIPS 197 AES-128-CTR decryption, online O(1)-per-trace 1st- and 2nd-order Correlation Power Analysis (CPA), blind cross-correlation clock alignment, and FIPS 140-3 TVLA Welch's t-test leakage verification at 60 fps in the browser. Nothing is uploaded, and your custom silicon configuration or sealed vault challenge travels in the link.

ice · liveSwitch target HSM presets (01 Unshielded, 02 Noisy Rail, 03 Jitter ±7, 04 Boolean Masked, 05 Dual-Rail WDDL), click any lane B00–B15 to solo all 256 competing correlation hypotheses, toggle hardware defenses live, or switch to 2nd-order centered-product CPA to pierce 1st-order Boolean masking.open ↗

1. Why AES-128 breaks byte by byte: Correlation Power Analysis

Trying all 2^{128} keys at once is impossible. In Round 1 of AES-128, however, each byte b \in \{0, \dots, 15\} passes independently through the nonlinear Rijndael S-Box:

v_b = \operatorname{SBox}(p_b \oplus k_b)

That divide-and-conquer structure shrinks 2^{128} down to 16 \times 256 = 4{,}096 independent byte hypotheses (Brier, Clavier & Olivier, CHES 2004). For each random plaintext p^{(n)} and each key guess k \in [0..255], the probe predicts a zero-mean leakage value h_{n,k} — either Hamming Weight \operatorname{HW}(v_b) - 4 (precharged bus) or Hamming Distance \operatorname{HW}((p_b \oplus k_b) \oplus v_b) - 4 (in-place register overwrite) — and correlates it against the measured analog voltage V_n(t) at every Round-1 clock sample t:

r(k, t) = \frac{N \sum h_{n,k} V_n(t) - \left(\sum h_{n,k}\right)\left(\sum V_n(t)\right)}{\sqrt{\left(N \sum h_{n,k}^2 - \left(\sum h_{n,k}\right)^2\right)\left(N \sum V_n(t)^2 - \left(\sum V_n(t)\right)^2\right)}}

Switch the scope to solo 256 hyps and click any lane B00–B15: the 255 wrong hypotheses collapse together inside a shrinking \pm 3/\sqrt{N} slate-cyan noise tube, while the single leaking key byte shoots cleanly out of the noise at the exact nanosecond cycle t = 44 + 2b. Because the sealed dispatch below is decrypted live with real AES-128-CTR, even 15 of 16 bytes locked still yields complete avalanche gibberish — snapping into readable plaintext the instant byte 16 locks.

2. FIPS 140-3 TVLA: proving whether a chip leaks at all

You don't need to know a chip's leakage model to certify whether it leaks. Hardware certification labs (ISO/IEC 17825, FIPS 140-3) run Test Vector Leakage Assessment (TVLA): feed the device an interleaved stream of a fixed plaintext and fresh random plaintexts, and compute Welch's two-sample t-test at every clock cycle t:

t(s) = \frac{\mu_{\text{fixed}}(s) - \mu_{\text{rand}}(s)}{\sqrt{\frac{s_{\text{fixed}}^2(s)}{N_f} + \frac{s_{\text{rand}}^2(s)}{N_r}}}

Whenever |t(s)| \ge 4.5 (dashed crimson rails on the lower scope), the two trace populations are statistically distinguishable (p < 10^{-5}) and the chip fails certification. Notice on 01 Unshielded how not just Round 1, but all ten AES rounds erupt crimson across the 160-cycle trace — and watch the entire 10-round storm vanish inside the cyan \pm 4.5\sigma pass corridor the moment you switch on 1st-order masking or balanced dual-rail WDDL.

3. The countermeasures arms race

Every hardware switch in the right console models a real physical defense — and its real-world failure mode:

  1. Thermal & switching noise (\sigma): Try 02 Noisy Rail (\sigma = 3.10). Noise doesn't eliminate leakage; it pushes required trace counts up quadratically (N \propto \sigma^2).
  2. Leakage model calibration (HW vs. HD): Flip silicon to HD reg while leaving the probe on HW weight. Because the AES S-Box is strongly nonlinear, \operatorname{HW}(v) and \operatorname{HW}(u \oplus v) are nearly orthogonal — correlation dies flat until you match the probe model to the silicon.
  3. Random clock jitter + cross-correlation resync: Try 03 Jitter (±7). Shifting the post-trigger AES core by \pm 7 random cycles smears S-Box peaks across adjacent time samples and blinds raw CPA. Toggle trace resync (xcorr) and ice.wasm aligns each incoming trace blindly via normalized cross-correlation against an exponentially averaged Round-1 envelope — snapping all 16 bytes straight back into lock.
  4. Operation shuffling: Enabling shuffle subbytes applies a fresh Fisher–Yates permutation to the 16 Round-1 S-Box lookups on every encryption, dividing single-cycle correlation by 1/16\times (~256\times more traces needed).
  5. 1st-order Boolean masking vs. 2nd-order CPA: Try 04 Masked. On every encryption, the HSM draws fresh random per-byte masks m \in [0..255], loads m at t = 12..27, and computes masked outputs v \oplus m at t = 44..75. Because m is uniformly random, \mathbb{E}[\operatorname{HW}(v \oplus m) \mid p, k] = 4 — both 1st-order CPA and 1st-order TVLA stay completely flat. Yet multiplying the centered residuals of the mask-load cycle and masked S-Box cycle obeys the exact Prouff–Rivain–Bevan identity:

\mathbb{E}\bigl[(\operatorname{HW}(m) - 4)\cdot(\operatorname{HW}(v \oplus m) - 4)\bigr] = 2 - \tfrac{1}{2}\,\operatorname{HW}(v)

Switch the probe order from 1st-order to 2nd-order (mask) (watch the cyan arc link each byte's mask cycle to its S-Box cycle on the scope!) and watch the masked HSM crack open. Now turn noise \sigma or shuffle subbytes on top of masking: 2nd-order SNR degrades quadratically (\text{SNR}_2 \propto \text{SNR}_1^2), which is why certified smartcards always layer masking with noise and hiding. 6. Dual-Rail Precharge Logic (WDDL): Try 05 Dual-Rail. Every data bit travels on paired true and complementary wires (b, \bar{b}) so total Hamming weight is constant (8 per byte) at higher static current draw (+6.5 mV on the scope). At 0% rail skew, both CPA and TVLA stay flat. Drag rail skew \varepsilon above 0% to model real-world parasitic routing capacitance asymmetry, (1+\varepsilon)\operatorname{HW}(v) + (1-\varepsilon)(8-\operatorname{HW}(v)) - 8 = 2\varepsilon(\operatorname{HW}(v) - 4), and watch residual leakage return.

Cross-site signal

Two of the sealed HSM dispatches (01 Unshielded and 04 Masked) carry encrypted Tessier-Ashpool / Kuang-XI transmissions tied into Radio Lab, Cyberspace, and the site's L0 → L3 Netrunner Clearance dossier — crack them to log clearance in the ` shell (clearance).

Honest hardware limits

This bench simulates textbook CMOS side-channel physics locally in the browser rather than probing physical hardware:

  1. No external trace ingestion: ice.wasm generates 100% synthetic traces in memory and never touches real hardware interfaces or external files.
  2. Real silicon is messier: Physical microcontrollers sit behind decoupling capacitors, power-delivery impedance networks, simultaneous switching of parallel 32-bit ALU pipelines, and EM probe positioning drift — typically requiring template attacks, PCA/LDA dimensionality reduction, or elastic dynamic time warping rather than clean integer-lag cross-correlation.
  3. Higher-order certified HSMs: Modern secure elements combine 2nd- or 3rd-order Threshold Implementations / DOM masking with internal clock randomization, dummy rounds, and active shields to push practical extraction past millions of traces.

Built with

  • Zero-dependency Rust → WebAssembly (ice.wasm, 49 KB): NIST FIPS 197 AES-128 & CTR vault cipher, 160-cycle CMOS power rail simulator with 3-tap RC shaping, blind normalized cross-correlation aligner, online O(1)-per-trace sufficient-statistic 1st- and 2nd-order CPA engines, and Welford online FIPS 140-3 TVLA.
  • HiDPI Canvas 2D + Web Audio: Live oscilloscope + TVLA dual-band renderer, 256-hypothesis solo trace tube, 16-lane correlation matrix, convergence plotter, annotated 1200×920 Hard Copy PNG dossier exporter, and opt-in procedural Web Audio cues.

Back to Labs · inspect static binary structure in Byte Lab · tune the intercepted frequencies in Radio Lab · view your dossier on Blackwall · see how this site works.