← Back to section · Post-Quantum Cryptography
HQC: NIST's Backup Key Encapsulation Mechanism for ML-KEM
In March 2025 NIST selected the code-based KEM HQC for standardization as a heterogeneous backup to ML-KEM. This article explains why a backup is needed, how HQC works, and what its standardization timeline looks like.
Why a KEM needs a backup
ML-KEM (FIPS 203) is today’s default for post-quantum key establishment, but its security rests on a single family of assumptions: the hardness of Module-LWE. That assumption has survived years of scrutiny and shows no sign of cracking — yet cryptographic history counsels humility. In 2022, SIKE, a finalist in this very process, was completely broken by a classical attack running on an ordinary computer. Algorithms rarely erode gradually; they tend to fall all at once.
A mature migration strategy therefore cannot place every egg in one mathematical basket. NIST’s answer is to standardize a backup KEM from a different mathematical family. If the lattice assumption ever fails unexpectedly, the ecosystem can switch to an algorithm whose security is independently sourced, instead of restarting a multi-year standardization process from zero. That is exactly the role HQC was selected to fill.
What HQC is
HQC (Hamming Quasi-Cyclic), developed by Aguilar Melchor and co-authors from around 2018 onward, is a key encapsulation mechanism built on error-correcting codes. Its security reduces to two long-studied problems: the syndrome decoding problem for random linear codes — given a parity-check matrix and a syndrome, find a low-weight error vector — and the structured decoding problem for quasi-cyclic codes. These problems have been analyzed since the late 1970s; the best known attacks, information-set decoding and its refinements, remain exponential in the parameters, and no quantum algorithm is known to change that picture fundamentally.
In construction, HQC uses quasi-cyclic codes to keep public keys compact, layered with a decodable inner code so that decapsulation — which is literally an act of decoding, correcting deliberately introduced errors — succeeds with overwhelming probability. The residual decryption failure rate is engineered to negligible levels, as required for the Fujisaki–Okamoto-style transform that delivers IND-CCA2 security.
HQC comes in three parameter sets, HQC-128, HQC-192, and HQC-256, targeting NIST security categories 1, 3, and 5 respectively. The inner code is a concatenated construction (a Reed–Muller/Reed–Solomon-type combination in the reference specification) whose job is purely reliability: it guarantees that the errors introduced during encapsulation sit comfortably within decoding range, while the outer quasi-cyclic structure carries the secrecy. This separation — one code for hardness, one for correctness — is the design’s defining feature, and it is also why HQC’s operations are dominated by decoding steps that are inherently heavier than ML-KEM’s polynomial arithmetic.
The decryption failure rate: a code-based KEM’s weak point
Code-based KEMs carry a soft spot that lattice schemes do not: decoding can fail. Errors are injected deliberately during encapsulation and the decoder’s correction capability has a hard ceiling, so a non-zero decryption failure rate (DFR) always exists. This is not merely a reliability concern — if the failure rate is not low enough, an attacker can statistically exploit “which ciphertexts fail” to recover information about the private key; reaction attacks of this kind have been demonstrated successfully against structurally related QC-MDPC schemes. HQC’s parameter design must therefore drive the DFR down to a level that is negligible relative to the target security category, backstopped by a strict CCA transform. The cost is that error-correction margin must be generous, which is one of the deeper reasons HQC’s sizes resist compression: reliability, secrecy and size pull against each other within a single parameter set.
The other code-based candidate of round four: BIKE
The code-based lane of round four actually had two runners. BIKE likewise rests on the decoding hardness of quasi-cyclic codes, with sizes in the same range as HQC’s. Judging from the framing of NIST’s fourth-round report, the eventual choice of HQC turned on considerations including the maturity of the security analysis and how rigorously the decoding failure behaviour could be argued. The lesson is that a backup contest is not only about whether the assumption families differ; it is also about whether failure behaviour is provably under control — for a decoding-based KEM, that ranks almost as high as security itself.
How it differs from ML-KEM
| Dimension | ML-KEM (FIPS 203) | HQC (in standardization) |
|---|---|---|
| Assumption | Module-LWE (lattices) | Quasi-cyclic syndrome decoding (codes) |
| Public key | 800–1,568 bytes | about 2,249–7,245 bytes |
| Ciphertext | 768–1,568 bytes | about 4,481–14,485 bytes |
| Relative speed | Fast, NTT-friendly | Decoding is heavier; slower than ML-KEM |
| Role | Primary, standardized | Backup, being standardized |
Two differences matter. First, assumption diversity: lattices and codes are independent research traditions, and a cryptanalytic breakthrough in one does not transfer to the other — that independence is the entire point of a backup. Second, size: quasi-cyclic structure shrinks code-based public keys from Classic McEliece’s hundreds of kilobytes down to a few kilobytes, but HQC’s keys and ciphertexts are still several times larger than ML-KEM’s. For handshake-heavy, bandwidth-sensitive protocols such as TLS, HQC is not the natural default; for settings where keys change rarely and assurance dominates, it is entirely practical.
Standardization timeline
On 11 March 2025, NIST announced in its fourth-round status report (NIST IR 8545) that HQC had been selected for standardization, explicitly as a backup to ML-KEM; the other fourth-round candidates, including Classic McEliece, were not selected. On NIST’s announced schedule, a draft HQC standard is expected out for public comment in 2026, with the final standard around 2027. These are planned dates, and the authoritative source for any change is NIST itself. In the same period NIST also published draft implementation guidance for KEMs generally (SP 800-227), a sign that implementers are expected to design for a world with more than one standardized KEM from the outset, rather than retrofitting diversity later.
What this means for migration work
Nothing changes in the short term: ML-KEM remains the deployment default, and the current hybrid posture (X25519 + ML-KEM-768) is unaffected. HQC matters over the medium term, as a concrete reason to build real crypto-agility: algorithm identifiers, key formats, and negotiation logic should never hard-code ML-KEM as the only possibility. When the HQC standard lands, high-assurance systems gain a fully vetted fallback. A backup earns its keep not on ordinary days, but on the one day the primary assumption fails.
One implementation-level caution deserves adding: HQC’s decoding steps must run in constant time. If decoding duration varies with the error pattern, timing itself leaks information related to the private key. The side-channel audit focus for code-based schemes differs from that for lattice schemes — for the latter it sits mostly in noise sampling and the NTT, for the former in every branch of the decoder. If HQC is ever adopted in earnest, the ML-KEM audit checklist cannot simply be reused; this is one more reason algorithm replaceability has to be budgeted at the engineering level in advance.
References
- NIST, NIST IR 8545: Status Report on the Fourth Round of the NIST Post-Quantum Cryptography Standardization Process, 2025. https://csrc.nist.gov/pubs/ir/8545/final
- NIST news release, NIST Selects HQC as Fifth Algorithm for Post-Quantum Encryption, 11 March 2025. https://www.nist.gov/news-events/news/2025/03/nist-selects-hqc-fifth-algorithm-post-quantum-encryption
- HQC official website (specification and parameters). https://pqc-hqc.org
- NIST, Post-Quantum Cryptography Standardization (project page). https://csrc.nist.gov/projects/post-quantum-cryptography
Tags: HQCNISTKey EncapsulationCode-Based Cryptography