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

Sengim Karayalcin, Marina Krcek, Stjepan Picek

Abstract

Side-channel analysis (SCA) represents a realistic threat where an attacker observes unintentional physical leakage—such as power consumption or electromagnetic emissions—to obtain secret data. While deep learning (DL) has proven to be an extremely powerful SCA approach, its black-box nature limits its utility for security evaluators who need to understand leakage mechanisms to improve hardware defenses. This work demonstrates that mechanistic interpretability can effectively scale to realistic SCA scenarios. By reverse-engineering the features a network learns during sudden performance "phase transitions," we can retrieve secret masks and move from black-box to white-box security evaluation.

The Black-Box Problem in Side-Channel Analysis

Side-channel analysis is a critical tool for both attackers and security certification labs. Deep learning models are the current gold standard for these attacks because they can autonomously bypass complex countermeasures like "masking," where a secret value is split into multiple random shares. However, these models are notoriously opaque. A model might successfully break a device, but it won't tell the evaluator how it did it or which specific part of the hardware implementation is leaking information. This lack of transparency makes it difficult to provide actionable feedback to hardware designers. This research bridges that gap by applying mechanistic interpretability to the specialized domain of hardware security.

A Framework for White-Box Evaluation

The researchers propose a three-step framework to peer into the internal logic of DLSCA models:

  1. Logit Analysis: By monitoring raw prediction scores (logits) and metrics like Perceived Information (PI) during training, researchers identify "phase transitions"—sudden jumps in performance that signal the moment a model learns a specific algorithmic feature.
  2. Activation Analysis (PCA): Applying Principal Component Analysis to internal network activations reveals how the model organizes data. They discovered that models project the relationship between secret shares into structured geometric grids within their latent space.
  3. Activation Patching: To establish causality, the researchers "intervene" in the model's internal state. By fixing specific internal features to extreme values and observing the resulting output changes, they can directly retrieve the values of secret masks from the model's internal representations.
The three-step framework for mechanistic interpretability in side-channel analysis: Logit Analysis, Activations Analysis, and Reverse Engineering Masks via activation patching.

Key Insights: Emergent Geometry and Phase Transitions

Learning Happens in "Quanta"

Much like the phenomenon of "grokking" observed in toy mathematical models, DLSCA models do not learn linearly. Instead, they experience discrete phase transitions. A model might initially learn coarse features, such as distinguishing between high and low Hamming Weights (the number of '1' bits in a byte), before suddenly "clicking" into a state where it can distinguish fine-grained properties like parity (even vs. odd values).

Emergent Latent Geometry

One of the most striking findings is that neural networks naturally organize the relationship between secret shares into a grid-like structure in their latent space. By identifying the axes of this grid, researchers can effectively "read" the internal random masks the device is using. This structure appears to be "weakly universal," emerging across different datasets (power vs. EM) and hardware architectures (ARM Cortex-M4 vs. 8-bit AVR).

Evolution of model logits and internal activations (PCA) across a phase transition from Epoch 50 to Epoch 100, showing the emergence of structured geometric representations of cryptographic shares.

Key Results and Implications

  • Mask Recovery: The researchers successfully reverse-engineered secret masks from model activations without any prior knowledge of those masks.
  • Causal Validation: Using activation patching, they proved the model had truly learned the underlying algebraic structure of the masking scheme. For instance, fixing internal "mask features" to zero allowed the model to predict the other secret share with high accuracy.
  • Bit-Level Insights: On the industry-standard ASCAD dataset, the analysis showed that models prioritize learning the least significant bits (LSBs) of the S-box output first, as these provide the clearest initial path to generalization.

Limitations and Future Directions

While powerful, this is a post-hoc analysis that requires a model to have already successfully "broken" the target. If a model fails to generalize, these methods offer limited insight. Additionally, identifying which Principal Component corresponds to which secret share currently requires domain-specific knowledge. Future work aims to automate this discovery process and extend the analysis to Transformer-based architectures, which are becoming increasingly prevalent in the side-channel analysis community.

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 security certification process. 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 Krcek 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},
}
Figure