Why this matters: ML-KEM (Kyber) is the NIST-standardized post-quantum KEM, but cryptographic diversity matters. BIKE offers an alternative based on error-correcting codes โ€” a mathematical family with 45+ years of cryptanalysis. If lattice assumptions break, code-based crypto survives.

Code-Based Cryptography Primer

Error-Correcting Codes: The Foundation

Error-correcting codes (ECCs) allow a sender to encode data so that a receiver can detect and correct errors introduced during transmission. Cryptographers discovered that the difficulty of decoding a random linear code can be used as the basis for a public-key cryptosystem.

The idea: the private key is a structured code that's easy to decode. The public key disguises this structure so that decoding looks like solving a hard problem for anyone without the private key.

Simple Parity Check Example

A parity check matrix H defines which bit patterns are valid codewords. If a received word r satisfies H ยท r = 0, it's valid. Otherwise, the non-zero result (the syndrome) reveals where errors occurred.

Enter exactly 4 binary digits (0 or 1)

QC-MDPC Codes

Quasi-Cyclic Moderate-Density Parity-Check (QC-MDPC) codes are the mathematical backbone of BIKE.

  • Quasi-Cyclic (QC): The parity check matrix H is built from circulant blocks โ€” each block is fully determined by its first row, which is cyclically shifted to fill the remaining rows. This gives compact key representation.
  • Moderate-Density Parity-Check (MDPC): H is sparse but not as sparse as classical LDPC codes. The row weight w is roughly O(โˆšn), providing a balance between decodability and security.
  • Structure: H = [Hโ‚€ | Hโ‚] where Hโ‚€ and Hโ‚ are rร—r circulant matrices, each defined by a single row polynomial of weight w/2.
H =
[
Hโ‚€ r ร— r circulant
|
Hโ‚ r ร— r circulant
]

BIKE-1 (Level 1): r = 12,323 โ€” each circulant block defined by a row of weight w/2 = 71

The LPN Hardness Assumption

BIKE's security rests on the Learning Parity with Noise (LPN) problem โ€” specifically, the difficulty of decoding a random quasi-cyclic code. Given a random syndrome s = H ยท e where e is a sparse error vector, recovering e is believed to be hard even for quantum computers.

This is related to the Syndrome Decoding Problem, which has been studied since the 1960s and is NP-hard in the worst case.

From Codes to Key Encapsulation

BIKE builds a Key Encapsulation Mechanism (KEM) on top of QC-MDPC codes. The private key holder knows the sparse structure of H and can decode efficiently. Everyone else faces a hard decoding problem. Next: let's generate a BIKE keypair.