arXiv:2609.35205cs.CRSep 2026

Manuscript Offprint

arXiv:2609.35205

OT-PCA: New Key-Recovery Plaintext-Checking Oracle Based Side-Channel Attacks on HQC with Offline Templates

Haiyue Dong, Qian Guo

Haiyue Dong and Qian Guo

Lund University, Lund, Sweden

{haiyue.dong,qian.guo}@eit.lth.se

Abstract. In this paper, we introduce OT-PCA, a novel approach for conducting Plaintext-Checking (PC) oracle based side-channel attacks, specifically designed for Hamming Quasi-Cyclic (HQC). By calling the publicly accessible HQC decoder, we build offline templates that enable efficient extraction of soft information for hundreds of secret positions with just a single PC oracle call. Our method addresses critical challenges in optimizing key-related information extraction, including maximizing decryption output entropy and ensuring error pattern independence, through the use of genetic-style algorithms.

Extensive simulations demonstrate that our new attack method significantly reduces the required number of oracle calls, achieving a 2.4-fold decrease for hqc-128 and even greater reductions for hqc-192 and hqc-256 compared to current state-of-the-art methods. Notably, the attack shows strong resilience against inaccuracy in the PC oracle—when the oracle accuracy decreases to 95%, the reduction factor in oracle call requirements increases to 7.6 for hqc-128.

Lastly, a real-world evaluation conducted using power analysis on a platform with an ARM Cortex-M4 microcontroller validates the practical applicability and effectiveness of our approach.

Keywords: Code-based cryptography · NIST post-quantum cryptography standardization · HQC · Side-channel attacks · KEM

1 Introduction

Post-Quantum Cryptography (PQC) has rapidly become an essential area in modern cybersecurity, aimed at mitigating the significant threats posed by quantum computers to existing cryptographic infrastructures. These infrastructures largely depend on the computational challenges associated with factoring and discrete logarithms—both of which are susceptible to quantum attacks. In response, the National Institute of Standards and Technology (NIST) initiated a project in 2016 to identify and standardize quantum-resistant public-key cryptographic algorithms, focusing primarily on Key Encapsulation Mechanisms (KEM) and digital signatures. As part of this initiative, the lattice-based CRYSTALS-Kyber has been adopted as the primary KEM standard [SAB +^{+}22]. Nevertheless, NIST continues to explore a diverse array of algorithms to ensure a secure and resilient cryptographic infrastructure. This includes evaluating code-based KEMs such as Classic McEliece [ABC +^{+}22], HQC [AAB +^{+}22], and BIKE [ABB +^{+}22], as well as the isogeny-based SIKE [JAC +^{+}22], which has been compromised.

Among these, Hamming Quasi-Cyclic (HQC) emerges as a particularly promising candidate. NIST reports [ACD+22][ACD^{+}22] have highlighted that both BIKE and HQC, built on structured codes, are apt for general-purpose KEM applications not dependent on lattice

OT-PCA: New KR-PC-SCAs on HQC with Offline Templates

structures. NIST has indicated that it may choose one of these two for standardization after the fourth round of evaluation. Given this context, it is crucial to thoroughly assess HQC's security credentials and develop robust implementation strategies for various real-world platforms to ensure its effectiveness and reliability in a post-quantum world.

During the initial rounds of NIST’s evaluation, the implementation security of HQC has been extensively studied, as documented in significant research efforts [WTBB +^{+}19, PT19, BDH +^{+}19, GJN20, XIU +^{+}21, SHR +^{+}22, GHJ +^{+}22, HSC +^{+}23, GLG22, GNNJ23, PRJB23, GMGL24, SGG24]. Among the various threats, Side-Channel Attacks (SCA) have emerged as particularly critical, necessitating thorough investigations to ensure secure implementations. These attacks exploit indirect data, such as timing differences, power consumption, or electromagnetic leaks, to extract sensitive information.

This paper focuses on a pivotal class of side-channel attacks in post-quantum cryptography, namely key-recovery Plaintext-Checking (PC) oracle based side-channel attacks targeting HQC. The objective of these attacks is to recover the security key of HQC by constructing a PC oracle through side-channel measurements. This PC oracle is capable of determining whether a specific ciphertext c corresponds to a predetermined message m, thus facilitating the detection of decryption failures. Such an oracle can bypass Chosen Ciphertext Attack (CCA) secure transformations like the Fujisaki-Okamoto (FO) transformation [FO99], compromising the security of Indistinguishability under Chosen Ciphertext Attack (IND-CCA) secure KEMs.

These attacks are highly effective, exploiting a range of side-channel vulnerabilities as shown in studies on timing attacks [GJN20, GHJ+22], power and electromagnetic (EM) attacks [RRCB20, UXT+22, SHR+22], and micro-architecture attacks [WPH+22, CWS+24, SGG24], including cache timing attacks [HSC+23]. They can leverage both substantial and minimal leakages, from strong power/EM signals [UXT+22] to subtle timing variations in high-performance CPUs [SGG24].

Beyond identifying new sources of side-channel leakages for constructing a PC oracle, a primary research challenge lies in enhancing attack efficiency by minimizing the number of required PC oracle calls. Each oracle call translates to one or several side-channel measurements, which often become bottlenecks due to real-time interaction limitations with the target system. These limitations are imposed by system constraints, security measures, or other operational factors.

Earlier versions of HQC, prior to the third round of the NIST PQC competition, utilized a tensor product code that combined repetition codes with BCH codes. Certain parameter sets of these versions were susceptible to decryption failure attacks, as noted in [GJ20]. From the October 2020 release onward, HQC has shifted to using concatenated codes that integrate Reed Solomon (RS) and Reed Muller (RM) codes. This shift introduces new challenges for PC oracle based attacks because the decoding properties of Reed Solomon and Reed Muller codes are more complex than those of tensor product codes.

Recent advancements [GHJ+22, SHR+22, HSC+23, GNNJ23, SGG24] have significantly reduced the number of required PC oracle calls for the latest version of HQC. From the initial report at CHES 2022 [GHJ+22], which required over 800 000 calls for hqc-128, subsequent works have progressively lowered this figure: to nine thousand at ASIACRYPT 2023 [GNNJ23], and down to one thousand at USENIX Security 2024 [SGG24]. These reductions mark substantial progress. Yet, there remains the question of whether further reductions are feasible. Additionally, this research strives to develop algorithms optimized for practical applications, particularly in settings where constructing a perfectly accurate PC oracle is challenging, such as in complex environments or when robust security measures are in place.

Contributions We introduce OT-PCA, a novel approach to key-recovery PC oracle based side-channel attacks on HQC. We summarize the key contributions as follows.

Our initial conceptual contribution is a novel method for efficiently extracting soft information representing the likelihood of entries in an HQC key block being non-zero. This method leverages the publicly available decoder to construct “offline templates” (OTs). Unlike traditional template attacks targeting specific devices, our OTs exploit the interaction in the decoding process between predefined error patterns and sparse vectors sampled from HQC’s secret key distribution. Specifically, adding a sampled sparse vector to a given error pattern may cause bit flips in the latter, changing the likelihood of decryption successes or failures. By summarizing the sparse vectors leading to each decryption result, we empirically estimate position-wise probabilities, representing the probability of each position in the sparse vector being non-zero conditional on the decryption result. During the online attack phase, when the decryption result of a new unknown sparse vector—the key block—is observed, we can thus infer the probability of each of the positions within the key block being non-zero using the estimated position-wise empirical probabilities, i.e., offline templates.

This method enables the extraction of substantial soft information for hundreds of secret entries with a single oracle call, significantly enhancing the efficiency of PC oracle based side-channel attacks on HQC for full key recovery.

Our second major contribution tackles the challenge of identifying error patterns for template construction that maximize information extraction during subsequent attack stages. The most critical element of this process is the first optimization problem—finding error patterns that maximize the entropy of the decryption outcomes. By ensuring that each decryption output—success or failure—is approximately equally probable, our method effectively enhances the information gain from each future decryption instance. In the paper, we advance our methodology by employing a set of error patterns instead of an individual pattern, thereby leveraging the collective information they provide. To ensure the patterns in the set are as independent as possible, we solve the second optimization problem—finding the set of error patterns that maximize the sum of pairwise Hamming distances. We develop simple genetic-style algorithms to efficiently solve these two problems, refining the error patterns used in constructing offline templates.

To summarize, the complete OT-PCA process begins with selecting several error patterns and constructing offline templates without calling the PC oracle. Subsequent online attack steps involve generating chosen ciphertexts, calling the PC oracle to obtain decryption outputs, and collecting secret information by combining these outputs with the offline templates. This process is further enhanced by a new, straightforward Information Set Decoding (ISD) algorithm that leverages soft information for efficient key recovery.

Our simulation results demonstrate the high efficiency of this novel attack. A comparative analysis with previous methods using a perfect oracle (accuracy of 1) is shown in Table 1, where our method significantly reduces the number of required PC oracle calls. For hqc-128, our approach achieves a 2.4-fold reduction in calls compared to the state-of-the-art [SGG24]. For hqc-192 and hqc-256, the reductions are even more substantial, with improvements of 87 and 137 times, respectively, compared to [SHR+22][SHR^{+}22]. These results mark major advancements over existing techniques, notably, the work [SGG24], which struggles with hqc-192.

Furthermore, with a less precise oracle (accuracy of 0.95), the improvement factor for hqc-128 increases to 7.6 compared to the previous best approach [SGG24]. This demonstrates the robustness and efficiency of our attack under challenging conditions, such as exploiting subtle microarchitectural timing leakages [SGG24] or targeting masked implementations [UXT +^{+}22], where constructing a perfect PC oracle is difficult.

The OT-PCA method represents a significant advancement in PC oracle based attacks (PCA) on HQC, with potential applications beyond side-channel attacks to other domains such as misuse attacks [BDH +^{+}19, HV20] and fault-injection attacks [XIU +^{+}21, HPP21], whenever a PC oracle can be constructed.

OT-PCA: New KR-PC-SCAs on HQC with Offline Templates

Table 1: Comparison of our attack with previous works: number of perfect PC oracle calls required for key recovery attacks against HQC. The symbol ‘—’ indicates that the number is not provided in the corresponding work.

Workhqc-128hqc-192hqc-256
GHJLNS22 [GHJ+22]>800 000——
SHRWS22 [SHR+22]1 152×461 920×561 920×90
HSCGJ23 [HSC+23]>50 000——
SCA-LDPC [GNNJ23]9 000——
Zero-Tester [SGG24]1 094——
Our work10×4622×5614×90

Lastly, we perform a real-world evaluation of our attack using power analysis on a platform with an ARM Cortex-M4 32-bit RISC core, targeting the PQClean implementation of hqc-128. The attacks were conducted across 120 different runs, each with a newly generated key. The outcomes from these real-world tests match our simulation results, demonstrating the practical effectiveness of our approach.

The source code is available at https://github.com/ot-pca/ot-pca.

Organization The rest of the paper is organized as follows. Section 2 provides the necessary background on HQC and an overview of PC oracle based side-channel attacks on HQC, including their threat model and general approaches for recovering the secret key from the constructed PC oracle. Section 3 details the new attack methodology. In Section 4, we present simulation results for various accuracy levels of the assumed PC oracle and validate these findings on a real-world platform. This is followed by a discussion of the gains and potential extensions of the new attack methods in Section 5. Finally, in Section 6, we conclude the paper and suggest future research directions.

References (35)