It's Not Just a Phase: On Investigating Phase Transitions in Deep Learning-based Side-channel Analysis

Sengim Karayalcin, Marina Krček, Stjepan PicekSubmission to ICML 2025 · Rejected

TL;DR

Deep learning side-channel attacks can effortlessly crack masked cryptographic hardware, but operate as black boxes that leave security evaluators guessing how the breach occurred. By adapting mechanistic interpretability to noisy side-channel traces, this paper demonstrates that neural networks learn to combine masked shares via discrete "phase transitions." By analyzing activation geometry and applying activation patching, the authors reverse-engineer the device's secret random masks without prior knowledge, turning black-box attacks into white-box evaluations.

What Problem Does This Paper Address?

Side-Channel Analysis (SCA) recovers cryptographic keys (such as AES) by measuring physical side effects like power consumption or electromagnetic emissions. To prevent SCA, implementations use masking, splitting sensitive values across multiple random shares ($s = s_1 \oplus s_2$).

While Deep Learning-based Side-Channel Analysis (DLSCA) can break masked implementations without needing human-guided feature engineering, deep neural networks remain notoriously opaque. A successful attack confirms that a device is vulnerable, but fails to tell hardware evaluators which physical operations leaked or how the model combined the shares. Furthermore, standard mechanistic interpretability (MI) techniques typically assume clean, toy inputs or known algorithmic variables—conditions that break down in SCA due to extreme noise, high trace dimensionality, and completely hidden random masks.

Methods

The authors introduce an interpretability workflow focusing on the discrete jumps in generalization—phase transitions—observed during training (measured via Perceived Information, or PI):

  1. Logit Analysis: Immediately after a phase transition, output logit distributions are analyzed across target classes to identify which high-level properties the network has learned to distinguish (e.g., high vs. low Hamming weight, even vs. odd parity, or specific bit values).
  2. Activation PCA Analysis: Performing Principal Component Analysis (PCA) on intermediate representations reveals geometric structures (such as grids and diagonals) in the top components, reflecting how the network organizes combinations of secret shares.
  3. Activation Patching: To establish causal mechanisms, activations corresponding to one share's principal component are clamped to extreme values (e.g., 0 or 8). The network’s output then directly reflects the other varying share. This lets researchers reconstruct the secret masks and compute their Signal-to-Noise Ratio (SNR) in the time domain to pinpoint exactly when and where the device leaks.

Datasets

The authors evaluate their approach on three standard, publicly available AES-128 benchmarks with first-order Boolean masking:

  • CHES CTF 2018: Power consumption traces of AES-128 executed on an ARM Cortex-M4 (32-bit). Resampled to 15,000 points per trace (30,000 profiling traces, 10,000 attack traces).
  • ESHARD-AES128: Electromagnetic (EM) measurements from a software-masked AES-128 on an ARM Cortex-M4 without shuffling (90,000 profiling traces, 10,000 attack traces).
  • ASCAD: EM emissions from an AVR RISC (8-bit) microcontroller running AES with variable keys. Traces are resampled to 2,000 points (200,000 profiling traces, 10,000 attack traces).

Key Insights and Ideas

  • Phase transitions reflect discrete feature discovery: Echoing grokking and the quantization model of neural scaling, DLSCA models do not learn smoothly. Instead, they acquire distinct algorithmic building blocks in sudden phase shifts.
  • Algebraic structure emerges in PC space: For Hamming Weight (HW) targets, the first transition separates high vs. low HW along diagonals. A second transition separates parity (even vs. odd HW), forming a $9 \times 9$ grid in latent space corresponding to all share combinations.
  • Evidence for weak universality: Models trained on entirely different measurement modalities and targets (power on CHES CTF vs. EM on ESHARD) formed nearly identical geometric PC representations during their initial phase transitions.
  • Unsupervised mask extraction: By intervening directly in the latent space (activation patching), the authors extract the hardware's internal random masks without having supervision labels for the masks during training.

Key Results

  • CHES CTF: Identified two distinct phase transitions (epochs 15–40 and 70–85). Patching PC activations successfully isolated the mask ($r_m$) and masked intermediate ($S\text{-box}[p_i \oplus k_i] \oplus r_m$), producing clear SNR peaks matching the exact device execution cycles.
  • ESHARD: Exhibited one phase transition at epoch 4 (high/low HW separation). Rotating PC coordinates and patching reconstructed the underlying share distributions matching ground truth.
  • ASCAD: Linear probes revealed the model specifically extracts the two least significant bits (LSBs) of both the S-box input and output (probe accuracies significantly higher than the remaining bits, which hovered near random guessing at ~0.55). A linear probe predicting the resulting 16 input-output bit clusters achieved 0.64 accuracy and accounted for the model's predictions with an entropy gap of only 0.27 bits (probe PI of 2.47 vs. model PI of 2.58).

Limitations and Future Work

  • Requires a successful attack model: The analysis assumes the network has already successfully extracted a subkey; it cannot explain models that fail to converge.
  • Manual component tuning: Identifying the relevant PCs and rotating/aligning coordinate axes for intervention still requires manual inspection.
  • Partial extraction on complex targets: On ASCAD, where leakage is bitwise rather than full-byte HW, output shares collapsed into 2–3 clusters instead of 4, showing that activation patching requires further refinement when leakage behavior is non-uniform.
  • Future Work: Automating circuit discovery across traces, developing tailored leakage models based on discovered latent structures, and applying the method to non-profiled attack paradigms.

Summary updated

Abstract

Side-channel analysis (SCA) represents a realistic threat where the attacker can observe unintentional information to obtain secret data. Evaluation labs also use the same SCA techniques in the process of security certification. The results in the last decade have shown that machine learning, especially deep learning, is an extremely powerful SCA approach, allowing the breaking of protected devices while achieving optimal attack performance. Unfortunately, deep learning operates as a black-box, making it less useful for security evaluators who must understand how attacks work to prevent them in the future. This work demonstrates that mechanistic interpretability can effectively scale to realistic scenarios where relevant information is sparse and well-defined interchange interventions to the input are impossible due to side-channel protections. Concretely, we reverse engineer the features the network learns during phase transitions, eventually retrieving secret masks, allowing us to move from black-box to white-box evaluation.
BibTeX
@misc{karayalcin2025it,
  author = {Sengim Karayalcin and Marina Krček and Stjepan Picek},
  title = {{It's Not Just a Phase: On Investigating Phase Transitions in Deep Learning-based Side-channel Analysis}},
  year = {2025},
  eprint = {2502.00384},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.00384},
}

Loading related content...

Figure