Ranking Loss: Maximizing the Success Rate in Deep Learning Side-Channel Analysis

Gabriel Zaid, Lilian Bossuet, François Dassance, Amaury Habrard, Alexandre Venelli

Introduction

Side-Channel Analysis (SCA) is a powerful class of cryptographic attacks that exploit physical leakages—such as power consumption, electromagnetic emissions, or timing—to extract secret keys from hardware implementations. In recent years, Deep Learning (DL) has revolutionized SCA, particularly in breaking implementations protected by masking or desynchronization. However, most Deep Learning Side-Channel Analysis (DLSCA) models rely on Categorical Cross-Entropy (CCE) as their primary loss function.

In this research, authors from Univ Lyon and Thales ITSEF argue that CCE is fundamentally misaligned with the goals of an attacker. They propose a novel Ranking Loss (RkL) function that shifts the training objective from absolute classification accuracy to the relative ranking of the secret key, directly optimizing for the Success Rate (SR) of the attack.

The Problem: Metric Mismatch in SCA

Standard deep learning models are trained as classifiers. CCE is a "pointwise" metric designed to maximize the absolute probability assigned to the correct class. While effective for image recognition, this approach faces two significant hurdles in the context of SCA:

  1. Metric Mismatch: An attacker does not necessarily need the model to be 100% confident in a specific key. The ultimate goal is the Success Rate (SR)—ensuring the correct key is ranked first among all possible hypotheses after processing a set of leakage traces. A model can have low absolute probability for the correct class but still be a perfect distinguisher if the correct key is consistently ranked higher than the alternatives.
  2. Theoretical Gaps: CCE optimizes for "Perceived Information," which serves only as a lower bound for the Mutual Information between the secret and the leakage. In low Signal-to-Noise Ratio (SNR) environments, this gap introduces approximation and estimation errors that hinder the model's ability to converge on the optimal distinguisher.

Methodology: Learning to Rank

To bridge this gap, the researchers adapted "Learning to Rank" (LTR) techniques—commonly used in information retrieval and search engines—to the side-channel domain.

Pairwise Ranking

Instead of treating the problem as a multi-class classification task, RkL treats it as a ranking task. The model is trained to answer a simpler question: "Is key hypothesis A more likely than key hypothesis B?" By performing pairwise comparisons, the loss function penalizes the network whenever the score of the correct secret key is lower than the scores of incorrect hypotheses.

Differentiable Approximation

Because "rank" is a discrete, non-differentiable value, it cannot be used directly in gradient descent. The authors utilize a sigmoid approximation to create a smooth, differentiable version of the ranking function. This allows the model to be trained using standard backpropagation.

The Alpha Parameter

A critical component of this approach is the hyperparameter α. This parameter controls the steepness of the sigmoid function. By tuning α, evaluators can control how aggressively the model pushes the correct key to the top of the list, allowing for flexibility based on the noise level of the target dataset.

Experimental Results

The authors evaluated RkL against CCE using three benchmark datasets: Chipwhisperer (high SNR), AES_HD (low SNR, FPGA-based), and ASCAD (masked and desynchronized traces).

Efficiency and Convergence

The results demonstrate that RkL significantly outperforms CCE in terms of data efficiency and training speed:

  • Trace Reduction: On the AES_HD dataset, the RkL-trained model required only 20,000 profiling traces to successfully extract the key, compared to 24,870 traces required by the CCE model.
  • Faster Convergence: Across the tested environments, RkL reached the optimal solution up to 23% faster than standard cross-entropy.
  • Noise Robustness: RkL showed superior resilience in high-noise scenarios. When Gaussian noise was added to Chipwhisperer traces, RkL remained effective at noise levels where CCE-based models either failed or required substantially more data.

Feature Selection

Beyond raw performance, visualization of the neural network's internal weights revealed that RkL is more adept at identifying true "Points of Interest" (PoIs). While CCE models were occasionally distracted by noisy peaks that appeared to be correlated but were actually false positives, RkL remained focused on the samples that contained the actual secret-key leakage.

Limitations and Future Work

Despite its advantages, Ranking Loss introduces new challenges:

  • Computational Overhead: Because RkL involves pairwise comparisons across all key hypotheses, it is more computationally intensive. Training time per epoch can increase significantly (e.g., a 4x increase on the AES_HD dataset).
  • Hyperparameter Sensitivity: The α parameter requires careful tuning. If α is too small, the ranking is imprecise; if it is too large, it can lead to vanishing gradients.
  • Listwise Ranking: This study focused on pairwise ranking. The authors suggest that "listwise" approaches—which consider the entire rank order of all 256 hypotheses simultaneously—could offer even greater improvements in future research.

Conclusion

By aligning the training objective with the attacker's ultimate goal—the ranking of the secret key—Ranking Loss provides a more robust and efficient framework for Deep Learning Side-Channel Analysis. It effectively eliminates the approximation errors inherent in cross-entropy, making it a powerful tool for evaluating the security of cryptographic implementations in noisy and protected environments.

Summary updated

BibTeX
@article{zaid2021ranking,
  author = {Gabriel Zaid and Lilian Bossuet and François Dassance and Amaury Habrard and Alexandre Venelli},
  title = {{Ranking Loss: Maximizing the Success Rate in Deep Learning Side-Channel Analysis}},
  journal = {IACR Trans. Cryptogr. Hardw. Embed. Syst.},
  year = {2021},
  url = {https://openreview.net/forum?id=oQSX-ZG272r},
}
Figure