Single-Trace Attacks on the Message Encoding of Lattice-Based KEMs

Bo-Yeon Sim, Jihoon Kwon, Joohee Lee, Il-Ju Kim, Taeho Lee, Jaeseung Han, Hyo Jin Yoon, Jihoon Cho, Dong-Guk HanIACR ePrint 2020

Abstract

Lattice-based Key Encapsulation Mechanisms (KEMs) are leading candidates in the NIST Post-Quantum Cryptography (PQC) standardization process due to their balance of efficiency and security. However, while these algorithms are mathematically robust against quantum adversaries, their physical implementations may be vulnerable to side-channel attacks (SCA). This paper investigates a critical vulnerability in the message encoding phase of several NIST finalists. By exploiting "determiners"—intermediate values with high Hamming weight variance—and employing deep learning techniques, researchers achieved a 100% success rate in recovering secret keys for CRYSTALS-KYBER and SABER from a single power consumption trace. The study further demonstrates that standard compiler optimizations fail to mitigate these leakages.

Introduction

As the industry prepares for the post-quantum era, the physical security of cryptographic implementations on embedded devices, such as smart cards and IoT sensors, becomes paramount. Side-channel attacks typically require thousands of operations to extract a signal from noise. This research focuses on the more potent "single-trace" attack, where an adversary recovers the entire secret key from a single observation of a device's power consumption during the encapsulation phase.

Methodology

The authors identified vulnerabilities within the message encoding step, where a secret message is transformed into a mathematical polynomial. They developed three distinct attack methodologies:

  1. Clustering-based Attack (Type 1): This targets "determiners"—intermediate values whose physical properties, such as Hamming weight, vary significantly based on a secret bit. For instance, a bit value of 0 might result in a 0x0000 mask, while 1 results in 0xFFFF, creating a massive, detectable power spike.
  2. ML-based Single-bit Attack (Type 2): In the absence of obvious determiners, deep learning models were trained to recognize subtle power signatures of individual bits processed sequentially.
  3. ML-based Multi-bit Attack (Type 3): For algorithms processing multiple bits simultaneously, complex machine learning models were used to classify bit combinations.

Experiments were conducted using a ChipWhisperer UFO STM32F3 target board featuring an ARM Cortex-M4 processor.

Key Insights and Experimental Validation

The "Determiner" Vulnerability

In algorithms like CRYSTALS-KYBER, the reference implementation uses a 16-bit mask derived from a single message bit. The resulting Hamming weight difference (0 vs. 16) causes the secret bit to produce a distinct signature in the power trace, allowing for trivial clustering of bit values.

Power consumption distribution for 'set 0' and 'set 1' in CRYSTALS-KYBER, illustrating the clear separation caused by the 'determiner' effect.

Optimization as a False Security Measure

A common misconception is that high-level compiler optimizations (e.g., -O3) might obscure side-channel leakages by increasing code complexity. However, experimental results showed that the "determiner" leakage remains highly visible and exploitable across all optimization levels.

Power consumption distributions across different compiler optimization levels (0, 1, 2, 3, and s), showing that the leakage persists regardless of the optimization used.

Results and Impact

The attacks proved highly effective against the NIST Round 3 candidates:

  • CRYSTALS-KYBER: Achieved a 100% success rate for full key recovery using a single trace.
  • SABER: Achieved a 100% success rate by combining ML results with a minimal exhaustive search ($2^{11}$ candidates).
  • FrodoKEM: Success rates exceeded 79%, reaching nearly 100% when optimizations were disabled.

The authors successfully mapped these vulnerabilities to the broader suite of lattice-based KEM candidates, including NTRU and NTRU Prime, indicating a systemic issue in reference implementations.

Conclusion and Countermeasures

The study highlights that mathematical complexity does not equate to physical security. Reference implementations provided for standardization often lack side-channel protections. To mitigate these risks, the authors suggest shuffling—randomizing the order of bit processing—as an effective countermeasure. However, they caution that shuffling must be robust enough to resist "de-shuffling" techniques. Future research will likely explore the efficacy of combined defenses, such as masking and shuffling, against these single-trace methodologies.

Summary updated

BibTeX
@article{sim2020single,
  author = {Bo-Yeon Sim and Jihoon Kwon and Joohee Lee and Il-Ju Kim and Taeho Lee and Jaeseung Han and Hyo Jin Yoon and Jihoon Cho and Dong-Guk Han},
  title = {{Single-Trace Attacks on the Message Encoding of Lattice-Based KEMs}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2020},
}
Figure