← Back to section · Post-Quantum Cryptography
BIKE and QC-MDPC: Shrinking Code-Based Public Keys by Two Orders of Magnitude with Quasi-Cyclic Structure
What if Classic McEliece's public key is too large? BIKE's answer is quasi-cyclic moderate-density parity-check codes: the algebraic structure of circulant matrices reduces the public key to a single row, why bit-flipping decoding suffices, and why the decoding failure rate is this scheme's security pressure point.
The same hard problem, a different answer
McEliece’s security record is impeccable; its only original sin is public-key size. There are two ways to shrink the key: switch to a code with stronger algebraic structure, or give the code a compressible symmetry. BIKE (Bit Flipping Key Encapsulation) takes the second path: the code is still a random sparse-parity-check LDPC-style code, but constrained into quasi-cyclic shape — the parity-check matrix is assembled from circulant blocks, each generated by cyclically shifting its first row. Describing the whole public key then takes only that first row, and the key drops from McEliece’s hundreds of KB to a few KB, the same league as lattice schemes. The price is added structure, and structure is always the first object scrutinized on the attack surface — the fundamental difference between BIKE’s and McEliece’s security narratives.
The parameter shape of QC-MDPC
BIKE’s code length is on the order of twenty thousand; the parity-check matrix consists of two circulant blocks side by side, and the private key is the set of positions of ones in those two rows: a total weight on the order of a hundred, spread over a vector of length twenty thousand — the origin of the term “moderate density” (MDPC): far denser than communications-grade LDPC, far sparser than a random matrix. Density is the scheme’s pivotal parameter: too sparse, and the structure falls to low-weight codeword searches; too dense, and the decoder can no longer correct the errors. As in McEliece, encapsulation injects a fixed-weight random error (weight on the order of two hundred) and the ciphertext is the syndrome; the difference is that decapsulation relies not on algebraic decoding but on an iterative algorithm borrowed from communications engineering.
Bit-flipping decoding: good enough, but with a tail
Bit-flipping decoding is disarmingly un-cryptographic. Holding the private key (the sparse parity-check matrix), each coordinate participates in several parity equations; if a bit is in error, an unusually high fraction of the equations it participates in will be unsatisfied. The algorithm repeatedly counts each coordinate’s “unsatisfied count,” flips the bits above a threshold, and stops when the syndrome vanishes or iterations run out. Every round is a sparse matrix multiplication — astonishingly cheap — and within a few rounds the overwhelming majority of error patterns are corrected.
But “overwhelming majority” is exactly the problem: a tiny fraction of error patterns always refuse to flip out. That is the decoding failure rate (DFR). For a communications system, failure just means retransmission; for a KEM, mishandled failure is a security vulnerability. BIKE’s parameter choices press the DFR down to extreme lows (below the level IND-CCA security requires) by choosing density and threshold strategy carefully — modern implementations use counter-based black/gray-list flipping refinements, the BGF decoder — confirmed jointly by large-scale simulation and theoretical extrapolation.
A glimpse of BIKE’s KEM construction
Take BIKE’s encapsulation apart and its structure is recognizably of the McEliece lineage, with mechanisms of its own. The encapsulator randomly generates a message and deterministically derives an error pair from by hashing — the two components correspond to the two circulant blocks of the parity-check matrix, with fixed total weight. The ciphertext has two parts: the syndrome of the error pair, and a masked value formed by XORing with a hash output of the error pair. The decapsulator recovers the error pair by bit-flipping decoding with the private key, works back to , then recomputes the encapsulation and compares item by item; on any mismatch it takes the implicit-rejection path and returns a pseudorandom key derived from a backup secret. The step “derive the errors from ” deserves attention: it makes error generation independent of any additional randomness source while simultaneously enabling the re-encryption check — without knowing , an attacker cannot construct a malformed ciphertext that passes the comparison. This construction is a variant of the Fujisaki–Okamoto transform realized in the coding setting, echoing across the distance McEliece’s own KEM conversion: by different roads, both lift one-way encryption to a CCA-secure KEM.
Why failure leaks the private key
The reaction attacks of around 2016 taught every “decoding can fail” code-based scheme a lesson. The logic: whether a given error pattern fails depends on the relative geometry between the error positions and the private key’s sparse support; an attacker who can submit chosen ciphertexts repeatedly and observe success versus failure — even a single bit of outcome information — can statistically sketch the distribution of ones in the private key. The GJS attack is exactly this class of strike against QC-MDPC. This is why BIKE’s security argument has a whole extra chapter compared with McEliece: beyond computing information-set decoding costs, it must prove that at real parameters the mutual information between failure events and private structure is too low for a feasible attack, and seal the observation channel with constant-behavior failure handling (implicit rejection, indistinguishable success and failure). In NIST’s fourth round BIKE did not reach the final list; official concerns centered on performance and the maturity of these analyses rather than any actual break — it remains the best case study of the trade-off between structural compression and security margin.
The fork with HQC
BIKE and HQC are often mentioned in one breath — both rode the code-based track of NIST’s fourth round, and both advertise public keys far smaller than McEliece’s. But their compression philosophies differ: BIKE compresses the structure of the parity-check matrix (a quasi-cyclic sparse matrix, decoded by iterative flipping), while HQC compresses the algebraic representation of the code itself (an efficiently decodable polynomial code layered with a random code, decoded by algebraic tools, with the public key containing the seed of a random code). The difference is written plainly in the 2025 outcome: NIST selected HQC as the backup KEM, while BIKE stopped at the fourth round. Which is better in the abstract is not a one-sentence question, but the comparison at least shows that on the problem of “compression,” the analyzability of the decoding method — whether failure behavior can be rigorously characterized — often decides the evaluators’ trust more than the compression ratio itself.
Closing
BIKE displays the other pole of the code-based route: quasi-cyclic structure traded for size, iterative decoding traded for speed, at the cost of making the decoding failure rate part of the security argument. Against McEliece’s “no structure, all algebra, zero failures,” these are engineering philosophies of entirely different temperament. Understand BIKE’s trade-offs and you can read the whole code-based family spectrum: from the most conservative old hand to the most aggressive compressor, every step in between is a different mixture of the same set of variables.
Tags: BIKEQC-MDPCQuasi-Cyclic CodesBit-Flipping Decoding