>_ Skip to main content
Menu
Search

Post-Quantum Cryptography and Encryption Field Guide

Code-Based Cryptography, Explained: The Oldest Post-Quantum Idea Still Standing

OLDEST
McEliece 1978
~50 years unbroken
NIST BACKUP
HQC
code-based KEM (2025)
WHY SAFE
No Shor-style break
syndrome decoding is hard
THE COST
Size
huge keys (McEliece)

Code-based cryptography is the oldest post-quantum idea still standing: Robert McEliece built a public-key system on error-correcting codes in 1978, and its binary-Goppa-code versions have resisted practical attack for nearly 50 years. It works by turning error correction into a lock, hiding a structured code so that recovering the message means solving the syndrome-decoding problem, which has no efficient classical or quantum attack. In 2025 NIST picked a lighter code-based scheme, HQC, as a backup to ML-KEM because it rests on different math. The catch is size: Classic McEliece’s keys run into the megabytes. And like all KEMs, it protects keys, not signatures, so it doesn’t guard your wallet.

Part of the Post-Quantum Cryptography and Encryption guide series

Turning error correction into a lock

Where it fits

Code-based schemes are key-encapsulation mechanisms: they establish shared keys, not signatures, so they don’t guard your wallet. For the family they sit in, see NIST’s PQC Standards Explained.

Error-correcting codes usually do the opposite of hiding things. They add redundancy so a garbled message can still be recovered, the trick that lets a scratched disc or a noisy signal come through clean. The original McEliece scheme turns that machinery into a lock. Its public key describes a structured error-correcting code disguised to look like a random one.

To encrypt, you encode a value with that public code and then add a deliberate pattern of errors. The private key contains the hidden structure needed to decode the result and remove the errors. Anyone else is left with the syndrome-decoding problem, recovering a low-weight error pattern from public code data. The general syndrome-decoding problem is NP-complete, and the best known attacks against the cryptographic instances used here still take exponential time.

Not every code-based scheme works the McEliece way. HQC, the one NIST picked, uses coding theory differently. Its quasi-cyclic structure is public, and its private key contains sparse secret values. The scheme’s security rests on structured syndrome-decoding assumptions. And the category itself isn’t spotless. Researchers have broken several McEliece variants built from other kinds of codes, so the security lives in the exact code and parameters, and the label “code-based” alone doesn’t guarantee much.

How McEliece locks a message

Not every code-based scheme works McEliece’s way. HQC, the one NIST picked, uses a public quasi-cyclic structure with sparse secret values. And the category isn’t spotless: several McEliece variants built from other kinds of codes have been broken, so the security lives in the exact code and parameters, and the label “code-based” alone doesn’t guarantee much.

Public key
a structured error-correcting code disguised as a random one
To encrypt
encode a value, then add a deliberate pattern of errors
Private key
the hidden structure that decodes and removes the errors
An attacker faces
the syndrome-decoding problem (NP-complete in general)

Why quantum computers don’t produce a Shor-style break

The reason this survives a quantum computer is subtler than the marketing suggests. Shor’s algorithm efficiently solves the factoring and discrete-logarithm problems behind RSA and elliptic-curve crypto. No known method lets it solve the syndrome-decoding problems behind HQC or Classic McEliece in anything like polynomial time, so there’s no Shor-style collapse waiting for them.

That doesn’t mean quantum computers are useless here. They can speed up classical decoding attacks through Grover-style search and related techniques, but the best known attacks remain exponential. The parameter sets account for those known quantum speedups. The value for NIST is that this hardness comes from a different place than the lattice problems, so a breakthrough aimed at ML-KEM‘s assumptions wouldn’t automatically reach it.

The careful claim

Shor solves the factoring and discrete-log problems behind RSA and elliptic curves. No known method lets it solve the syndrome-decoding problems behind HQC or Classic McEliece in polynomial time, so there’s no Shor-style collapse. Quantum computers can speed up classical decoding attacks via Grover-style search, but the best known attacks stay exponential, and the parameters account for that. The value for NIST: the hardness comes from a different place than lattices, so a breakthrough against ML-KEM wouldn’t automatically reach it.

The oldest scheme still standing: McEliece

Code-based cryptography dates to 1978, when Robert McEliece built a public-key system on a category of error-correcting codes called Goppa codes. Nearly 50 years on, no practical attack is known against the recommended binary-Goppa-code parameters, which is an unusually long clean run for a public-key design.

Attacks and security estimates have sharpened over the decades, and the parameter sizes have grown to keep pace, but the core idea has held. That record carried Classic McEliece, the modern version, deep into NIST’s process as a finalist. NIST didn’t standardize it in the end. The agency cited its enormous public keys and slow key generation, which make it unattractive for many common applications. McEliece-based encryption has since entered international standardization through an ISO amendment, so the design lives on outside the NIST track.

McEliece’s 50-year run

Attacks and security estimates sharpened over the decades and the parameter sizes grew to keep pace, but the core idea held, an unusually long clean run for a public-key design.

Born
1978 (Robert McEliece, Goppa codes)
Record
no practical attack on recommended binary-Goppa parameters in ~50 years
NIST outcome
a finalist, but not standardized (enormous keys, slow key generation)
Lives on
standardized via an ISO amendment

HQC: the smaller code-based option

SchemeFamilyPublic-key sizeNote
ML-KEMlattice800-1,570 Bthe compact choice
HQCcode~2,200-7,200 BNIST backup KEM (2025), finalize ~2027
Classic McEliececode261 KB – 1.3+ MBhuge keys; not NIST-standardized

HQC is the compromise NIST reached for. In March 2025 it selected HQC as a backup key-encapsulation mechanism alongside ML-KEM, giving the encryption side of the migration a second option on different assumptions. HQC is code-based too, but far lighter than McEliece. Its public keys run from about 2,200 bytes at the lowest security level to about 7,200 at the highest, against Classic McEliece’s 261 kilobytes to more than 1.3 megabytes across the same levels.

The tradeoff shows up in its ciphertexts, which are larger than ML-KEM’s, and in its newer security assumptions, which lack McEliece’s long history. ML-KEM stays the more compact choice overall, with public keys from 800 to about 1,570 bytes. NIST selected HQC in 2025 and has said it expects to finalize the standard in 2027.

Implications for your wallet

The wallet answer

HQC and Classic McEliece sit beside ML-KEM: they establish shared symmetric keys, and none of them produces signatures. A KEM hands two parties a shared secret; a symmetric cipher then protects traffic or stored data with it. So a code-based scheme could one day help guard your encrypted data, but none touches the signature that authorizes spending from your wallet. That needs a post-quantum signature (ML-DSA is one example) and blockchain support to use it, which Bitcoin doesn’t have today.

Code-based crypto gives the encryption side of the transition a separately studied family to fall back on, so it doesn’t rest on lattices alone. Your wallet’s protection still comes down to signatures.


This article is educational and does not constitute security or investment advice.

// FAQ

What is code-based cryptography?

Cryptography built on error-correcting codes. The original McEliece scheme hides a structured code so that recovering a message means solving the syndrome-decoding problem, which is hard for classical and quantum computers alike. NIST’s HQC is a modern code-based scheme.

Why is it called the oldest post-quantum idea?

Robert McEliece published the first version in 1978, and its binary-Goppa-code parameters have resisted practical attack for nearly 50 years, an unusually long clean run for a public-key design.

Why don't quantum computers break it?

Shor’s algorithm solves factoring and discrete logarithms, not syndrome decoding. There’s no known way to turn code-based problems into the form Shor exploits. Quantum search can speed up decoding attacks, but they stay exponential and the parameters account for it.

What's the catch with code-based schemes?

Size. Classic McEliece has enormous public keys (hundreds of kilobytes to over a megabyte), which is why NIST didn’t standardize it. HQC is far lighter (a few kilobytes) but has larger ciphertexts than ML-KEM and newer, less-tested assumptions.

Does code-based cryptography protect my crypto?

Not directly. Like all KEMs, HQC and McEliece establish shared keys, not signatures, so they can protect your encrypted data but not the signature that authorizes spending. That needs a post-quantum signature the blockchain adopts.

// Sources

  1. NIST, Post-Quantum Cryptography project (Classic McEliece) https://csrc.nist.gov/projects/post-quantum-cryptography
  2. NIST, NIST selects HQC as fifth algorithm (March 2025) https://www.nist.gov/news-events/news/2025/03/nist-selects-hqc-fifth-algorithm-post-quantum-encryption
  3. QNews, ML-KEM, Explained https://qnews.io/guides/post-quantum-cryptography/ml-kem-explained-post-quantum-key-exchange-in-plain-english/
  4. QNews, Lattice Cryptography, Explained https://qnews.io/guides/post-quantum-cryptography/lattice-cryptography-explained-the-backbone-of-post-quantum-security/
  5. QNews, NIST's PQC Standards Explained https://qnews.io/guides/post-quantum-cryptography/nists-pqc-standards-ml-kem-ml-dsa-slh-dsa-falcon-hqc-explained/