• Cryptography
  • Also: CRYSTALS-Kyber
  • Also: ML-KEM
  • Also: FIPS 203

Kyber (ML-KEM)

A lattice-based key encapsulation mechanism standardized as FIPS 203, serving as the primary post-quantum replacement for RSA and Diffie-Hellman key exchange.

Kyber, now officially named ML-KEM (Module Learning With Errors Key Encapsulation Mechanism), is the post-quantum key encapsulation mechanism (KEM) selected by NIST as the primary standard for replacing classical key exchange protocols like RSA-KEM and Diffie-Hellman. Published as FIPS 203 in August 2024, it is already being deployed in web browsers, TLS 1.3 implementations, and messaging protocols including Signal. Its selection was based on a strong security foundation, fast performance, and relatively compact key sizes compared to other post-quantum candidates.

The Module Learning With Errors problem

Kyber’s security rests on the hardness of the Module Learning With Errors (MLWE) problem. Given a matrix AZqk×k\mathbf{A} \in \mathbb{Z}_q^{k \times k} over a polynomial ring Rq=Zq[x]/(xn+1)R_q = \mathbb{Z}_q[x]/(x^n + 1), a secret vector s\mathbf{s}, and a small error vector e\mathbf{e}, the problem asks an adversary to distinguish the pair (A,As+e)(\mathbf{A}, \mathbf{A}\mathbf{s} + \mathbf{e}) from a uniformly random pair. The “module” structure (working over polynomial rings rather than plain integers) enables smaller keys and faster computation while maintaining a security reduction to worst-case lattice problems.

No known quantum algorithm solves MLWE significantly faster than the best classical algorithms. Shor’s algorithm provides no advantage here because lattice problems lack the algebraic periodicity that Shor’s algorithm exploits.

How Kyber works

Kyber follows an IND-CCA2 secure KEM construction built from an IND-CPA public-key encryption scheme via the Fujisaki-Okamoto transform:

  1. Key generation: Alice generates a random matrix A\mathbf{A} and secret vector s\mathbf{s} with small coefficients, then computes the public key t=As+e\mathbf{t} = \mathbf{A}\mathbf{s} + \mathbf{e}. The public key is (A,t)(\mathbf{A}, \mathbf{t}) and the secret key is s\mathbf{s}.

  2. Encapsulation: Bob samples a random message mm, derives randomness from it, encrypts mm under Alice’s public key by computing u=ATr+e1\mathbf{u} = \mathbf{A}^T \mathbf{r} + \mathbf{e}_1 and v=tTr+e2+q/2mv = \mathbf{t}^T \mathbf{r} + e_2 + \lceil q/2 \rfloor \cdot m. The shared secret is derived by hashing mm together with a hash of the ciphertext.

  3. Decapsulation: Alice uses her secret key to decrypt mm, re-encrypts to verify the ciphertext matches, and derives the same shared secret. The re-encryption check is critical for CCA2 security.

Parameter sets and key sizes

Kyber is defined at three security levels:

Parameter setSecurity levelPublic keyCiphertextShared secret
ML-KEM-512NIST Level 1 (~AES-128)800 bytes768 bytes32 bytes
ML-KEM-768NIST Level 3 (~AES-192)1,184 bytes1,088 bytes32 bytes
ML-KEM-1024NIST Level 5 (~AES-256)1,568 bytes1,568 bytes32 bytes

For comparison, RSA-2048 public keys are 256 bytes but RSA-4096 keys (needed for comparable long-term security) are 512 bytes. Kyber keys are larger, but the difference is modest enough for most applications. The performance comparison favors Kyber: key generation, encapsulation, and decapsulation are all faster than RSA operations at equivalent security levels.

Deployment status

Kyber is among the most rapidly adopted post-quantum algorithms:

  • TLS 1.3: Chrome and Firefox ship hybrid key exchange using X25519 combined with ML-KEM-768 (the “X25519Kyber768” or “X25519MLKEM768” key agreement)
  • Signal Protocol: Adopted a hybrid scheme combining X25519 with Kyber for forward-secure key exchange
  • Cloudflare and AWS: Both support post-quantum TLS using Kyber on their edge networks

The “hybrid” approach combines a classical key exchange with Kyber so that security is maintained even if one scheme is broken. This is the recommended deployment strategy during the transition period.

Why it matters for learners

Kyber is the most concrete example of how quantum computing motivates real-world changes to infrastructure. Understanding Kyber connects the theoretical threat of Shor’s algorithm to the practical response: billions of TLS connections are already being protected against future quantum attacks. For quantum computing students, Kyber also illustrates which mathematical problems quantum computers can and cannot solve efficiently. The lattice problems underlying Kyber appear to be in a complexity class that quantum computers cannot crack, unlike the factoring and discrete logarithm problems that Shor’s algorithm targets.

See also