A Plaintext-checking Oracle for Decapsulation Leakage in the NIST HQC FPGA Reference Implementation
(2025) EITM01 20252Department of Electrical and Information Technology
- Abstract
- In this thesis, we evaluate the side-channel security of the NIST HQC post-quantum cryptosystem by analysing the official FPGA decapsulation implementation. A hardware wrapper was created to interact with the HQC decapsulation modules, enabling ciphertext decapsulation with precise power trace capturing using a ChipWhisperer CW305 and Husky setup. A dataset with 20k power traces was generated from decapsulating two different ciphertext groups, having $m=0$ and $m=rand()$. Statistical leakage assessment revealed significant leakage about the message in both the SHAKE pseudorandom number generator and the decoder used in the HQC decoding stage.
A few machine-learning models were trained and evaluated on their distinguishing capabilities... (More) - In this thesis, we evaluate the side-channel security of the NIST HQC post-quantum cryptosystem by analysing the official FPGA decapsulation implementation. A hardware wrapper was created to interact with the HQC decapsulation modules, enabling ciphertext decapsulation with precise power trace capturing using a ChipWhisperer CW305 and Husky setup. A dataset with 20k power traces was generated from decapsulating two different ciphertext groups, having $m=0$ and $m=rand()$. Statistical leakage assessment revealed significant leakage about the message in both the SHAKE pseudorandom number generator and the decoder used in the HQC decoding stage.
A few machine-learning models were trained and evaluated on their distinguishing capabilities of determining the group of the message decapsulated from a single power trace. The best-performing model, a small convolutional neural network, achieved a validation accuracy of $97.2\%$. Using this oracle accuracy, a key-recovery simulation was performed, which showed that approximately 736 decapsulation traces were enough to recover the secret-key with a probability of $72.3\%$.
These results demonstrated that the 2021 NIST HQC FPGA implementation contains exploitable side-channel leakage and that both the SHAKE part and the decoding part require stronger countermeasures. (Less) - Popular Abstract
- As the digital world expands, so does the need for secure communication. Today everything from private messages to online banking uses encryption to protect data from getting into the wrong hands. But there is a problem. In the future it may become possible to break today’s secure cryptosystems using quantum computers. Therefore it is of importance that new cryptosystems are developed that can withstand quantum computing. One of these algorithms is called HQC, Hamming Quasi-Cyclic, which has been selected as one of the standard cryptosystems used by the U.S National Institute of Standards and Technology, NIST.
Even if HQC is a mathematically secure cryptosystem, the physical implementation running on a chip or CPU can leak information... (More) - As the digital world expands, so does the need for secure communication. Today everything from private messages to online banking uses encryption to protect data from getting into the wrong hands. But there is a problem. In the future it may become possible to break today’s secure cryptosystems using quantum computers. Therefore it is of importance that new cryptosystems are developed that can withstand quantum computing. One of these algorithms is called HQC, Hamming Quasi-Cyclic, which has been selected as one of the standard cryptosystems used by the U.S National Institute of Standards and Technology, NIST.
Even if HQC is a mathematically secure cryptosystem, the physical implementation running on a chip or CPU can leak information from different sources such as power consumption. This happens when the chip in question performs different operations creating small variations in, for example power consumption. These types of attacks using power consumption or electromagnetic radiation are called side-channel attacks. By measuring the power consumption during decryption, an attacker can sometimes get information about sensitive data such as the secret-key.
This thesis investigates whether the official NIST HQC FPGA implementation from 2021 is vulnerable to such attacks. A FPGA board was used to run the implementation which was measured with a measurement device. Tens of thousands of power traces were created by measuring the power consumption when running the HQC decapsulation.
The power traces were used to train machine-learning models to distinguish messages based on the power consumption leakage. A convolutional neural network was trained to distinguish these groups, achieving an accuracy of over $97\%$. If this is combined with known attack methods, it becomes possible to recover HQC secret-keys with fewer than one thousand power traces.
The conclusion is that the NIST HQC FPGA implementation from 2021 is vulnerable to side-channel attacks showing the need for stronger implementation designs capable of withstanding these kinds of attacks. This would make the cryptosystem not only secure in theory but also in real-life scenarios ensuring secure digital communication. (Less)
Please use this url to cite or link to this publication:
https://lup.lub.lu.se/student-papers/record/9216175
- author
- Halasz, Benjamin LU
- supervisor
-
- Qian Guo LU
- organization
- course
- EITM01 20252
- year
- 2025
- type
- H2 - Master's Degree (Two Years)
- subject
- keywords
- Side-channel attack, Public key encryption, HQC, Hardware, FPGA, Deep learning
- report number
- LU/LTH-EIT 2026-1106
- language
- English
- id
- 9216175
- date added to LUP
- 2026-01-12 07:28:00
- date last changed
- 2026-01-12 07:28:00
@misc{9216175,
abstract = {{In this thesis, we evaluate the side-channel security of the NIST HQC post-quantum cryptosystem by analysing the official FPGA decapsulation implementation. A hardware wrapper was created to interact with the HQC decapsulation modules, enabling ciphertext decapsulation with precise power trace capturing using a ChipWhisperer CW305 and Husky setup. A dataset with 20k power traces was generated from decapsulating two different ciphertext groups, having $m=0$ and $m=rand()$. Statistical leakage assessment revealed significant leakage about the message in both the SHAKE pseudorandom number generator and the decoder used in the HQC decoding stage.
A few machine-learning models were trained and evaluated on their distinguishing capabilities of determining the group of the message decapsulated from a single power trace. The best-performing model, a small convolutional neural network, achieved a validation accuracy of $97.2\%$. Using this oracle accuracy, a key-recovery simulation was performed, which showed that approximately 736 decapsulation traces were enough to recover the secret-key with a probability of $72.3\%$.
These results demonstrated that the 2021 NIST HQC FPGA implementation contains exploitable side-channel leakage and that both the SHAKE part and the decoding part require stronger countermeasures.}},
author = {{Halasz, Benjamin}},
language = {{eng}},
note = {{Student Paper}},
title = {{A Plaintext-checking Oracle for Decapsulation Leakage in the NIST HQC FPGA Reference Implementation}},
year = {{2025}},
}