← Back to section · Education & Knowledge Base
Code-Based Cryptography Entry: The Veteran Route from McEliece to HQC
Code-based cryptography rests on the decoding problem for error-correcting codes; its representative scheme, McEliece, dates to 1978, and in 2025 NIST selected HQC as the backup post-quantum KEM standard. This entry covers its definition, mechanism, lineage, and common points of confusion.
Code-based cryptography is a class of public-key cryptography whose security is rooted in the decoding problem from error-correcting code theory. It is as old as public-key cryptography itself: the McEliece scheme was published in 1978, just one year after RSA. In the post-quantum landscape, the code-based route is one of the oldest families with the longest cryptanalytic record. Although the first standards went to lattice cryptography, the code-based route — resting on an entirely different mathematical assumption — has always been an indispensable pole in the standards system’s diversity layout, and HQC’s selection in 2025 formally brought it into the standards sequence.
Definition: The Decoding Problem
Error-correcting codes add redundancy to data so it can still be recovered after noise. The general decoding problem is: given the generator matrix of an arbitrary linear code and a codeword corrupted by random errors, find the error positions. This problem is known to be NP-hard for a general linear code, and no quantum speedup is known. The basic technique of code-based cryptography is: choose a special code with an efficient decoding algorithm (such as binary Goppa codes) as the private key, and “disguise” its generator matrix as a seemingly random general code as the public key. Encryption deliberately adds errors to a codeword; only whoever knows the trapdoor structure can decode and remove them efficiently, while everyone else faces the general decoding problem.
Mechanism and Profile: Large Public Keys, Fast Operations
The McEliece scheme’s operations are extremely simple — encryption is a matrix multiplication plus random errors, decryption is error-correcting decoding — so its speed ranks at the top among all public-key schemes, and ciphertexts are only a few hundred bytes. The fundamental reason it has stood for over forty years is the stagnation of attacks: information-set decoding algorithms have improved continuously, but their complexity still grows exponentially with the parameters. The real weakness is the public key: to reach modern security levels, Classic McEliece public keys run to hundreds of kilobytes, up to roughly 1 MB — four orders of magnitude larger than elliptic-curve public keys. This hampers it in size-sensitive protocols such as certificates and handshakes, but it is entirely workable where public keys can be distributed in advance and stay fixed, such as offline devices, satellites, and private networks.
Lineage: From Goppa Codes to Quasi-Cyclic Codes
To compress key sizes, researchers turned to codes with algebraic structure: quasi-cyclic moderate-density parity-check codes (QC-MDPC) bring public keys down to a few thousand bytes, and BIKE and HQC are schemes on this branch, while rank-metric schemes form another sub-family. Structure brings efficiency but also new attack surface, so NIST reviewed such schemes with particular caution. In March 2025, NIST announced the selection of HQC as the backup key encapsulation algorithm to ML-KEM (the selection report is NIST IR 8545): HQC shares no mathematical assumption with ML-KEM, so if the lattice route ever suffers a surprise, the standards suite still has a fully reviewed alternative.
Current Status: Position in the Standards Suite
The code-based route’s positioning today can be summarized as “the veteran second tier”: Classic McEliece, with its ultra-long security record, is recommended by information security authorities in countries such as Germany for long-term confidentiality scenarios; HQC is proceeding along the “selected first, standardized next” path and is expected to become another KEM standard after FIPS 203. For deployers, code-based schemes matter in two ways: they offer an assumption-heterogeneous option for data with very long confidentiality horizons, and they remind the entire migration effort to preserve cryptographic agility — today’s backup may be tomorrow’s necessity.
The Attack Side: The Enduring War of Information-Set Decoding
The main weapon against code-based cryptography is information-set decoding (ISD): randomly guess a set of coordinate positions uncontaminated by errors; if the guess is right, decoding degenerates into solving linear equations; repeat the lottery until it hits. Since Prange’s original version in 1962, ISD has gone through generations of improvements — Stern, BJMM, and others — and quantum variants (combined with Grover search) have been carefully studied, but every improvement has only compressed constant factors in the exponent without changing the overall picture that cost grows exponentially with parameters. This is exactly why McEliece’s parameters have needed only gentle growth over forty years. As with lattice security estimation, code-based parameter selection rests on cost modeling of the best ISD variants, and authorities such as Germany’s BSI publish parameter recommendations periodically. Notably, structured variants (quasi-cyclic codes and the like) additionally require assessment of specialized attacks exploiting the structure — the recurring focus of NIST’s deliberations over HQC and BIKE: efficiency gains must be bought with more prudent parameter margins.
Points of Confusion
First, code-based cryptography has nothing to do with “encoding” (such as Base64); it refers to error-correcting codes. Second, a large public key does not mean weak security: McEliece’s security record is second to none among public-key systems; the large key is an engineering constraint, not a security defect. Third, HQC’s selection is not because ML-KEM is insecure — it is “insurance” the standards system deliberately bought: diversity is itself a security goal. Fourth, NP-hardness refers to the worst case; the security of concrete parameters still depends on practical complexity estimates for information-set decoding, and selection should follow the parameter recommendations of authoritative bodies.
Why the Code-Based Route Has Few Signatures
Attentive readers will notice that the code-based family has almost only KEMs and no influential signature standards. The reason lies in a construction asymmetry — the decoding problem naturally suits one-way encryption and encapsulation (the encryptor adds errors, the decryptor corrects them), but signatures require a structure “that only the private key holder can generate,” and using the decoding problem in reverse means the signer must prove knowledge of how to decode a codeword without revealing the structure; such constructions (like the CFS signature) have either enormous signatures or impractically slow signing. Code-based proposals exist in NIST’s additional signature call, but are generally considered immature. The foreseeable layout is therefore: the code-based route focuses long-term on the KEM direction as a backup to lattice KEMs, while the signature direction is split between lattices and hashes. Understanding this division of labor helps when reading each family’s parameter tables — an absence reflects structural reasons, not a security verdict.
In the encyclopedia’s entry network, this entry forms a contrast with lattice cryptography as the two classic mathematical foundations of PQC: one wins on balance, the other on seniority and heterogeneity — a key entry for understanding the standards diversity strategy.
Tags: Code-Based CryptographyMcElieceHQCKey Encapsulation