← Back to section · Post-Quantum Cryptography

BIKE: A Code-Based KEM Built on Bit-Flipping Decoding

BIKE builds key encapsulation from quasi-cyclic MDPC codes and an iterative bit-flipping decoder — the third route in code-based cryptography, alongside McEliece and HQC. This article explains its decoding mechanism, its failure-rate Achilles' heel, and its positioning as a fourth-round candidate.

Published 22 November 2026 · 5 min read · PQ Frontier

BIKE: A Code-Based KEM Built on Bit-Flipping Decoding
AI-generated site artwork
Video explainer · Algorithms: key encapsulation

The Third Route in Code-Based Cryptography

Code-based post-quantum schemes have three representatives: Classic McEliece trades Goppa codes for a forty-seven-year security record at the cost of public keys of hundreds of kilobytes; HQC, built on quasi-cyclic codes with a provably bounded decoding construction, was selected by NIST as the backup KEM; BIKE took a third road — quasi-cyclic moderate-density parity-check (QC-MDPC) codes plus iterative decoding. Its goal was explicit: within the code-based family, compress public keys into a range comparable to lattice schemes.

BIKE’s key structure is rather elegant. The private key is two sparse binary polynomials h0 and h1 (“moderate density” means their Hamming weight is far above the sparsity of a McEliece private key, yet far below random dense), and the public key is their ratio h = h1·h0^-1. To encapsulate, the sender randomly generates a pair of low-weight error vectors and “stirs” them into the ciphertext with the public key; the decapsulator uses the private key to recover the combined syndrome, then starts the decoder to hunt down the error vector bit by bit; hashing the error vector yields the shared secret. The scheme’s security rests on two problems: finding a low-weight codeword in a quasi-cyclic code (the syndrome decoding problem) is hard, and distinguishing the private key’s structure from the public key is hard.

Bit Flipping: A Greedy Error Corrector

BIKE’s signature component is its decoder — the bit-flipping algorithm. It is an iterative greedy strategy: for each bit of the ciphertext, count how many of the parity-check equations involving it are unsatisfied; the more unsatisfied equations a bit participates in, the more suspect it is of being an error itself; flip it if the count crosses a threshold, then repeat the whole process until all checks are satisfied or the iteration budget runs out. This decoder is simple to implement and fast, and it is the key to the MDPC route’s practicality.

But greedy decoding is probabilistic: some error patterns it simply cannot correct. BIKE’s engineering core therefore became driving the decoding failure rate (DFR) down to a cryptographically negligible level — not only must parameters leave enough margin, the decoder itself went through several upgrades, from the original version to improved variants such as Black-Gray-Flip, which specifically handle the error patterns that make naive flipping stall. In every version of the BIKE specification submitted to NIST, a substantial share of the text is devoted to arguing the DFR estimation methodology and the credibility of its extrapolation.

The Route Dispute with HQC

BIKE and HQC both belong to the quasi-cyclic code family, but they part ways at the most crucial point: the determinism of decoding. HQC chose a code construction with a provable correction radius (a concatenation of shortened Reed–Muller and Reed–Solomon codes), so its decoding failure rate can be computed analytically from the construction parameters, without relying on statistical extrapolation. BIKE’s bit-flipping decoder has no such analytic bound; its DFR figures come from large-scale simulation plus exponential extrapolation — simulation can only directly measure failure rates down to a point, and the lower tail must be fitted by a model. The review community’s main reservation about BIKE concentrated exactly here: if the extrapolation model deviates from the true tail behavior, the security margin is overestimated. The BIKE team invested enormous effort in response, improving the decoder (variants such as Black-Gray-Flip significantly lowered the failure rate at the same parameters) and giving conservative extrapolation methods in the specification, but the methodological disagreement never fully went away. When NIST chose HQC over BIKE in 2025, its public reasoning included the solidity of the security argument — the fact that HQC’s DFR is analytically computable carried weight in the final balance. Understanding this route dispute is understanding half of how code-based KEMs are evaluated.

Failure Rate Is Attack Surface

Why treat the DFR with such alarm? Because decoding failure is not an ordinary reliability problem; it is a security problem. Around 2016, Guo, Johansson, and Nilsson demonstrated a reaction attack against QC-MDPC-style schemes: the attacker crafts large numbers of ciphertexts, observes which decapsulations fail, and — because failure patterns correlate with the distance spectrum of the sparse polynomials in the private key — recovers the private key after enough samples. This means the DFR must be low enough that an attacker exhausting all queries cannot collect enough failure samples, and the decoder must run in constant time — jitter in running time likewise leaks information such as iteration counts, which correlate with error patterns.

A Quick Look at Sizes and Parameters

BIKE offers three parameter sets for NIST security categories 1, 3, and 5. The level-1 public key is about 1.5 KB and the ciphertext about 1.6 KB — within the code-based family, only HQC is comparably compact, and BIKE holds its own against lattice schemes; the private key itself is just two sparse polynomials, a few hundred bytes encoded, and in practice usually only a short seed is stored. The decoding iterations and threshold parameters of the three sets scale with the security level; the computational cost is spent mainly on polynomial multiplication and decoder iterations, with a single encapsulation/decapsulation on a general-purpose processor on the order of milliseconds. BIKE appears on no mandatory compliance list, but its specification and reference implementation remain publicly maintained, and for researchers it is still the most complete reference implementation of the QC-MDPC route.

BIKE entered NIST’s fourth-round candidate list and underwent the final evaluation of the code-based route alongside HQC; after NIST selected HQC for standardization in 2025, BIKE’s standardization prospects dimmed. But its historical place is established: it proved that code-based cryptography can achieve kilobyte-scale public keys, and it calibrated the field’s understanding that “failure rate is a security parameter.” For today’s selectors, BIKE is more like a mirror — when evaluating any probabilistically decoding KEM, first ask whether its DFR estimation method is credible, then ask whether its constant-time implementation has been tested; these two questions apply to every scheme of the same kind. Incidentally, BIKE’s experience also changed the field’s documentation habits: after it, specifications of probabilistically decoding schemes generally devote a full chapter to DFR estimation, giving simulation scale, extrapolation model, and conservative margin, rather than reporting a single bare exponent — a quiet legacy BIKE left to post-quantum engineering practice.

Tags: BIKECode-Based CryptographyMDPCBit Flipping