HQC Explained: The Code-Based Key Exchange Still Standing

HQC explained in plain terms means understanding the post-quantum key exchange built on error-correcting codes, a design that hides a secret inside a noisy codeword so that only the key holder can read it. The central question is how a code designed to fix errors can also hide secrets, and the answer is that decoding a noisy codeword without the key is a hard problem, and HQC turns that hardness into security.

HQC is a key-encapsulation mechanism designed by Carlos Aguilar Melchor and colleagues and submitted to the NIST post-quantum standardisation process in 2017. It is built on quasi-cyclic codes and the syndrome decoding problem, offers post-quantum security, and it reached the fourth round of the NIST process in 2022, where it remains under evaluation as a backup key-exchange standard.

This article explains what HQC is, how it works, and where it stands in the post-quantum world.

Key takeaways

  • HQC is a post-quantum key-encapsulation mechanism from 2017.
  • It is built on quasi-cyclic codes and syndrome decoding.
  • It reached the fourth round of the NIST post-quantum process.
  • It remains under evaluation as a backup key-exchange standard.
  • It trades larger keys for a conservative security story.

What HQC is

HQC is a scheme that lets two parties agree on a shared secret even if the attacker owns a quantum computer, passing codewords through noisy channels that only the key holder can decode. One side publishes a public key, the other encapsulates a random secret under that key, and the first side decapsulates it, and the shared secret that emerges is safe against quantum attacks.

Its signature feature is the quasi-cyclic code. Most code-based schemes use random codes that need huge keys, but HQC uses codes with a repeating structure, which means its public keys are far smaller than those of older code-based designs, and that compactness is what makes the scheme practical.

The design was a reaction to the NIST call for post-quantum standards. When NIST asked for schemes that could survive quantum computers, the HQC team chose the most studied code-based problem they could build on, because a standard that must last decades should rest on the fewest assumptions, and syndrome decoding is one of the oldest hard problems in coding theory.

It became one of the best-known alternate candidates in the NIST process, and it was praised for its simplicity even as other schemes won on speed. Reaching the fourth round was itself a mark of quality, because the process had started with dozens of submissions from around the world, and only the designs that survived public cryptanalysis stayed in the conversation.

Its most famous property is the name. HQC stands for Hamming Quasi-Cyclic, a name that says exactly what the design is built from, and it has stuck through years of study, which is a reminder that cryptographers still enjoy a name that explains itself.

Our guide to post-quantum cryptography explains the field HQC belongs to, and our guide to FrodoKEM explains the lattice scheme that took the same conservative path.

How HQC works

Everything starts with key generation, which produces a public key and a private key from a random seed. The private key is a pair of sparse polynomials, the public key is those polynomials combined with a random code, and the structure is what makes the public key small, because the quasi-cyclic form lets a short seed describe a large code.

Encapsulation begins with a random secret chosen by the sender. The sender encodes the secret as a codeword, adds a small error, and hides the result under the public key, which means the ciphertext looks like random noise to anyone without the private key, and only the receiver can strip the noise away.

The error is what makes the scheme work as a whole. Syndrome decoding is hard because a small amount of noise hides the structure of the codeword, and because the noise is added at every step, an attacker who sees the public key and the ciphertext cannot tell which parts carry the secret and which carry only noise.

The decoding step spreads the effect further. HQC decodes with an algorithm that corrects the errors using the private key, so that a change in one secret bit affects the whole ciphertext, and because the decoding is applied in decapsulation, a single changed bit spreads across the whole exchange within one round.

Decapsulation recovers the secret by decoding the noisy codeword. The receiver uses the private key to correct the errors, reads out the codeword, and recovers the secret, which means the rounding step turns noisy arithmetic back into an exact answer, and that decoding is what makes the scheme work in practice.

The shared secret is then fed into a key derivation function. Both sides arrive at the same secret value, which they hash together with the transcript to produce the session keys, and because the raw secret is never used directly, the derived keys are clean and safe to use.

A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it
A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it, shows how HQC works: codewords take turns through noisy decoding, step after step, until a shared secret emerges.

Comparing HQC with other post-quantum schemes

HQC is one of several post-quantum key-exchange schemes, and each was built with a different emphasis. Kyber is the lattice scheme that won the NIST standard with a ring structure, FrodoKEM is the conservative lattice scheme that avoided rings entirely, and HQC is the code-based one that avoided lattices altogether, while each approach trades something for something else.

The table below sets out the main contrasts between the leading approaches.

Aspect HQC Kyber FrodoKEM
Problem Syndrome decoding Module LWE Plain LWE
Based on Error-correcting codes Lattices Lattices
Quantum safe Yes Yes Yes
Key size Large Small Large
Best for Backup standard General use Conservative use

The practical result is that HQC is the right choice for a backup standard, Kyber suits general use everywhere else, and FrodoKEM fits conservative use instead.

Where HQC is used

Research uses it as a case study in code-based design. Cryptographers still cite HQC when they discuss how much structure a code-based scheme can afford, because it is the clearest example of a quasi-cyclic design, and that lesson shapes how new schemes are judged today.

Teaching uses it to show how code-based cryptography works. HQC is clean enough to explain in a lecture and well documented enough to implement in an afternoon, which makes it a favourite example in cryptography courses that cover post-quantum design and the ideas that shaped it.

Benchmarks use it to measure code-based schemes. When someone builds a new library or a new piece of hardware, HQC is one of the designs they test, because its decoding exercises different parts of a processor than lattice schemes do, and a platform that runs HQC well is likely to run most post-quantum schemes well.

Conservative deployments use it where diversity matters most. A small number of products and libraries include HQC support because it rests on codes rather than lattices, and those implementations keep running in the background of systems that were built around that choice, even though most new designs choose Kyber today.

Standards history uses it to mark the NIST process. HQC was part of the contest that chose the world’s post-quantum standards, and it represents the code-based path that contest explored, which means historians of the field return to it whenever they ask what post-quantum cryptography might have looked like.

Strengths and limits

The greatest strength of HQC is its different foundation. A scheme built on codes rather than lattices gives the world a backup if lattice assumptions ever weaken, and that diversity is real, measured in the independence of the two problems and confirmed by the designers’ own reasoning about structure.

It is also a strength that the design is easy to understand. A scheme built from codes, errors, and decoding is easy to implement, easy to analyse, and easy to test, and that simplicity is worth more than cleverness in a field where hidden complexity usually means hidden flaws.

The limits are real, though, and the biggest is size. HQC public keys and ciphertexts are much larger than Kyber’s, which means more bandwidth and more storage, so a system that values speed or size will usually choose a lattice-based scheme instead.

HQC checklist

  • Use HQC for study and backup deployments, not for new systems.
  • Remember it uses quasi-cyclic codes, not lattices.
  • Study its decoding to understand code-based cryptography.
  • Compare it with Kyber to see the foundation trade-off.
  • Note its large keys when planning bandwidth.
  • Test against published test vectors before trusting any implementation.
  • Keep seeds random and protect them as carefully as with any key.
  • Use a proper key derivation function, never the raw shared secret.
  • Choose Kyber for any system that needs a standard today.

Frequently asked questions

What is HQC in simple terms?

It is a post-quantum key-exchange scheme that lets two parties agree on a shared secret using noisy codewords, so even a quantum computer cannot break it.

Why is it called HQC?

After Hamming Quasi-Cyclic codes, the error-correcting codes at the heart of the design, which keep its public keys small enough to be practical.

How is HQC different from Kyber?

Both are post-quantum key exchanges, but HQC is built on error-correcting codes and syndrome decoding, while Kyber is built on lattices with rings for smaller keys.

Is HQC still secure?

Yes, no practical attack against it has been published, and its conservative design means it rests on one of the oldest hard problems in coding theory.

Why did HQC not win the NIST standard?

Because its keys and ciphertexts are much larger than Kyber’s, and NIST valued the performance of lattice-based designs for general use, while keeping HQC as a backup.

When should I use HQC?

When you study code-based cryptography, when you need a non-lattice backup, or when you want a scheme simple enough to implement without a lattice library.

The bottom line

HQC explained in one line is this: the scheme that kept a backup, a code-based design from 2017 that proved error-correcting codes could carry the quantum age.

It is proof that diversity is a design goal, and the reason it still matters is that every post-quantum scheme designed since has been judged partly by the lesson HQC taught.

This article is general information about how HQC works, not advice about choosing encryption for a particular device or system.

Latest articles

Scroll to Top