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:
- 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.
- 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.
- 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.
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).
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