ML Models Are Not Ciphers: Power Analysis for Weight Extraction Is Harder Than You Think

Mohammed Qaiss, Peter Horvath, Michal Shagam, Lejla Batina, Zhuoran Liu, Eyal Ronen, Mahmood Sharif, Yuval YaromarXiv 2026 · arXiv

TL;DR

While recent research suggests that machine learning (ML) model weights can be stolen via power-analysis side channels, this paper reveals that deep neural networks (DNNs) are fundamentally harder to "crack" than cryptographic ciphers. Due to the nature of floating-point arithmetic and the way models naturally reduce data entropy, the number of power traces required for full weight extraction grows exponentially with model depth, making the recovery of modern, deep architectures a massive computational and physical challenge.

What Problem Does This Paper Address?

In the world of hardware security, Correlation Power Analysis (CPA) is a classic technique used to extract secret keys from cryptographic devices by observing their power consumption. Recently, researchers have applied these same techniques to ML models, treating weights as "keys" and the model as a "cipher."

However, most prior work focused on "toy" examples: shallow networks, untrained models with random weights, or extracting only a few parameters. This paper addresses the gap between these proofs-of-concept and the reality of attacking fully trained, deep models like ResNet-18. The authors ask: Why is it so much harder to extract weights from a real DNN than a key from AES?

Methods

The authors developed a simulation-based framework to isolate the intrinsic mathematical challenges of weight extraction from the engineering hurdles of physical measurement.

Figure 2: End-to-end pipeline. We use the target model to generate simulated leakage traces from intermediate computation values. We then run a CPA attack on these traces to recover the network weights sequentially, weight-by-weight and layer-by-layer, updating the recovered model as extraction progresses. Finally, we evaluate the recovered model using test-set accuracy and weight-recovery metrics.

As shown in Figure 2, their pipeline involves:

  1. Simulated Trace Generation: Using ground-truth weights to generate noise-free power traces based on Hamming Weight (HW) and Hamming Distance (HD) leakage models.
  2. Sequential CPA Recovery: Attacking the model weight-by-weight and layer-by-layer. Because each layer's input depends on the previous layer's output, any error in recovery propagates and compounds.
  3. Novel Optimizations: They introduced "Adaptive Receptive Field" selection—choosing specific data samples that maximize input diversity for a given weight—and "Sign Correction" techniques to overcome ambiguities inherent in ML activations like ReLU.

Datasets

The study primarily uses the CIFAR-10 image classification dataset. To handle the massive trace requirements of deeper layers, they also utilized CIFAR-5M, a synthetic expansion of CIFAR-10 providing 5 million samples to ensure enough data variability for the CPA attack to function.

Key Insights and Ideas

  • ML Models are "Entropy Sinks": Cryptography aims to increase data entropy (making output look like random noise). In contrast, ML models are designed to reduce entropy to categorize data. As data flows deeper into a network, it becomes less diverse, making it much harder for CPA to distinguish between different weight candidates.
  • The Floating-Point Trap: Unlike the integer math in ciphers, DNNs use floating-point arithmetic. The authors found that "collisions" are frequent: because of rounding errors, two different weight guesses can produce the exact same power leakage, rendering them indistinguishable to an attacker.
  • Models are Not Random: Attacking a trained model is harder than attacking a randomly initialized one. Trained weights and natural image inputs have structures that further reduce the "leakage" available to an attacker compared to uniform random values.
  • Approximation is the Attacker's "Out": While bit-perfect weight recovery is nearly impossible for deep models, an attacker often doesn't need it. Recovering an approximate model that achieves similar accuracy or serves as a surrogate for generating adversarial examples is significantly easier.

Key Results

The complexity of weight extraction scales poorly with model depth. While a standard cryptographic primitive like AES-128 can be cracked with fewer than 10 noise-free traces, ML models require orders of magnitude more data.

Figure 1: The number of traces required for the extracted model to achieve baseline accuracy as a function of the number of layers, for different models. While the number of traces grows exponentially with the number of layers, the total number of weights in the model (in parentheses) seems to have little effect. For comparison, we add the AES cipher, modeling a CPA attack on the first-round S-box computation as one layer and 16 weights (one per key byte).

As illustrated in Figure 1:

  • A simple 8-layer CNN requires ~5,000 traces.
  • VGG-11 (11 layers) requires ~20,000 traces.
  • ResNet-18 (21 layers) could not be fully recovered even with 200,000 traces in an ideal, noise-free setting.

When realistic noise is added to the simulation, the requirements explode. For a pretrained EfficientNet-B0, the authors estimate that even 12 million traces are insufficient to accurately recover weights beyond the first layer.

Limitations and Future Work

The primary limitation is the sheer computational cost; the ResNet-18 simulation alone required approximately 2,400 GPU-hours, costing over $5,000 in cloud credits. Furthermore, the attack currently fails under realistic signal-to-noise ratios (SNR) for deeper layers.

Future work may explore whether models using integer-only arithmetic (common in quantized "edge" AI) are more vulnerable, as they lack the floating-point rounding issues identified here. Additionally, the authors suggest that new, non-CPA-based side-channel techniques will be necessary to realistically threaten modern, deep architectures like Transformers.

Summary updated

Abstract

Can power-analysis techniques reveal secret weights of machine-learning models? Multiple recent works demonstrate proof-of-concept attacks that can partially recover such weights. To that end, these works build on techniques from cryptographic engineering, treating the model as a ``cipher'' and its secret weights as keys. We question the basic assumption behind such straightforward adaptations of cryptographic attacks and highlight the challenges arising when applying past techniques to fully recover all layers of deep neural networks. Unlike past works, which extract only a few weights, typically from shallow layers, we investigate the recovery of complete networks. Moreover, we target fully trained and functional models, rather than untrained, randomly initialized networks. To focus on fundamental challenges, we assume an unrealistically strong side-channel adversary that can directly observe the output of the leakage model without any added noise. With this adversary, we show that machine-learning models differ significantly from cryptographic implementations, giving rise to unique challenges that have not been observed in the prior art. We observe two main differences between machine-learning models and ciphers. First, in contrast to the high-diffusion nonlinear integer arithmetic prevalent in cryptographic schemes, machine-learning models tend to use limited-precision floating-point arithmetic and low-diffusion linear operations. We show that these operations introduce difficulties in weight recovery, often requiring an unexpectedly large number of traces, even under ideal channel conditions. Second, we observe that, unlike ciphers, which aim to increase the data entropy, machine-learning models aim to reduce it. This reduces data variability as the algorithm progresses, hampering weight recovery in deep layers of the model. (details can be found in the paper)
BibTeX
@misc{qaiss2026ml,
  author = {Mohammed Qaiss and Peter Horvath and Michal Shagam and Lejla Batina and Zhuoran Liu and Eyal Ronen and Mahmood Sharif and Yuval Yarom},
  title = {{ML Models Are Not Ciphers: Power Analysis for Weight Extraction Is Harder Than You Think}},
  year = {2026},
  eprint = {2611.12532},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.12532},
}
Figure