Skip to main content
Post-Quantum Cryptography Advanced

FrodoKEM

FrodoKEM deliberately throws away the algebraic structure that makes lattice cryptography fast — trading performance for a security proof that rests on plain, 'vanilla' Learning With Errors. Learn how it works and why some cryptographers prefer that trade.

PL
Pashalis Laoutaris
August 5, 2026
7 min read

Interactive FrodoKEM Visualizer

🔐 FrodoKEM

Toy 4×4 plain-LWE — see the post for why real FrodoKEM needs 640+ dimensions.
Enter text and click a button to start!
Public Matrix A (4×4, mod 256)
Public Key B = A·S + E (mod 256)
Ciphertext B' = S'·A + E'
Ciphertext C = S'·B + E'' + encode(bits)
Recovered M = C − B'·S (diagonal, rounded)
Generate keys, then Encapsulate & Decapsulate.

FrodoKEM

Introduction

Most lattice-based post-quantum schemes — CRYSTALS-Kyber and SABER among them — get their speed from algebraic structure: they work over polynomial rings, which lets a single multiplication implicitly perform thousands of scalar multiplications at once. That structure is a huge performance win, but it’s also an extra assumption: nobody has broken Ring-LWE or Module-LWE, but nobody can prove the ring structure doesn’t secretly make the underlying lattice problem easier either. FrodoKEM (“Frodo” as in take the ring off — a pun on Ring-LWE) deliberately strips the ring structure away and works with plain matrices over the integers, the original, most-studied version of the Learning With Errors (LWE) problem. It’s slower and has larger keys, but its security rests on nothing but the bare LWE assumption, which is why it was included as a NIST post-quantum alternate candidate specifically for applications that want that conservative margin.

Table of Contents

The Learning With Errors Problem

LWE asks: given a random matrix A and b = A·s + e (mod q), where s is a secret vector and e is a small random “error” vector, can you recover s? Without the error, this would be ordinary linear algebra — trivial to solve with Gaussian elimination. The error is what makes it hard: it buries the linear relationship in noise just large enough that no known algorithm, classical or quantum, can efficiently separate signal from noise once the dimension is large enough. This is the same hardness assumption behind Kyber and SABER — FrodoKEM’s distinction is using it directly over plain integer matrices instead of polynomial rings.

Key Generation

  1. Generate a random public matrix A (n×n, entries mod q).
  2. Sample a small secret matrix S and a small error matrix E (n×n̄, entries drawn from a narrow distribution centered at 0 — real FrodoKEM uses a discrete Gaussian-like distribution; small uniform noise in a fixed range works the same way for a toy build).
  3. Compute the public key: B = A·S + E (mod q).
  4. The private key is S. A and B together form the public key.

Encapsulation and Decapsulation

To encapsulate a message (in real FrodoKEM this becomes a shared secret key; here we encode raw bits so the mechanism stays visible):

  1. Sample fresh small matrices S′, E′, E″ (the sender’s own secret randomness).
  2. Compute B′ = S′·A + E′ (mod q).
  3. Compute V = S′·B + E″ (mod q).
  4. Encode the message bits by adding q/2 onto the positions carrying a 1 bit: C = V + encode(bits) (mod q).
  5. The ciphertext is the pair (B′, C).

To decapsulate, the recipient (who holds S) computes:

M = C − B′·S (mod q)

Expanding this out: M = (S′·B + E″ + encode) − (S′·A + E′)·S = S′·E − E′·S + E″ + encode(bits). The three error terms are all small; the encoded bits are huge (0 or q/2) by comparison. Rounding each entry of M to the nearest of {0, q/2} recovers the bits — the small noise never gets close enough to the wrong rounding boundary to flip them.

Interactive Visualizer

Real FrodoKEM uses n = 640, 976, or 1344 with q = 2¹⁵ or 2¹⁶ — matrices that large make LWE’s noisy linear algebra computationally infeasible to invert without the secret. The visualizer above runs the exact same structure — a public matrix A, a noisy public key B = A·S + E, and matrix encapsulation/decapsulation — at a 4×4, mod-256 toy scale, so every multiplication and rounding step is visible and genuinely LWE, just far too small to be secure.

A Worked Example

Using the visualizer’s toy 4×4 parameters (q = 256):

  1. A random 4×4 matrix A and small secret/error matrices S, E produce the public key B = A·S + E mod 256.
  2. To send 4 bits, the sender samples its own small S′, E′, E″, computes B′ = S′·A + E′ and C = S′·B + E″ + encode(bits).
  3. The recipient computes C − B′·S mod 256 and rounds each diagonal entry to the nearer of 0 or 128 (= q/2).
  4. Because all the error terms stay well under the rounding threshold of 64, the bits come back exactly.

Why the Errors Don’t Break Decryption

This is the central balancing act of every LWE scheme: the error has to be large enough that recovering S from A and B is infeasible (small error ⇒ B leaks S almost exactly), but small enough that the residual noise in decapsulation (S′·E − E′·S + E″) never overlaps the halfway point between the two encoded values. Parameter selection — dimension n, modulus q, and the width of the error distribution — is the whole game in LWE-based cryptography, and FrodoKEM’s parameters were chosen conservatively (larger n than Kyber’s ring-based scheme needs, for the same security level) precisely because there’s no ring structure helping the noise stay well-behaved.

FrodoKEM vs. Ring/Module-LWE Schemes

FrodoKEM Kyber / SABER
Underlying problem Plain LWE (matrices) Ring/Module-LWE(R)
Public key size (~128-bit security) ~9.6 KB ~0.8-1 KB
Speed Slower (full matrix multiplication) Faster (polynomial multiplication via NTT)
Extra structural assumption None Ring/module structure

Kyber ultimately became NIST’s primary standardized KEM because the performance difference matters enormously at internet scale. FrodoKEM remains standardized as a conservative alternative for contexts — some government and long-term-archival use cases — where minimizing structural assumptions outweighs the bandwidth and speed cost.

FAQ

Is FrodoKEM actually slower than Kyber in practice?

Yes, noticeably — its keys and ciphertexts are roughly 10x larger, and matrix-vector operations without the Number Theoretic Transform speedup that ring structure enables are computationally heavier. This is the direct cost of its more conservative security assumption.

Why does removing the ring structure matter for security?

A ring or module structure means every element you’re multiplying is secretly a whole vector of numbers being combined by a fixed, structured pattern. If that pattern turned out to hide an exploitable weakness, every ring/module-LWE scheme sharing that structure would be affected at once. Plain LWE has no such shared structure — each matrix entry is independent, so an attack would have to work directly against LWE’s raw hardness rather than any structural shortcut.

Does FrodoKEM use the same encoding shown in the visualizer?

Not exactly — real FrodoKEM typically encapsulates a random shared secret (used to derive a symmetric key) rather than an arbitrary user message, and uses more sophisticated encoding across multiple bits per matrix entry. The visualizer’s diagonal 0/q-2 encoding preserves the same LWE noise-cancellation mechanism in a form that’s easy to watch happen.

Is FrodoKEM standardized by NIST?

It’s specified in NIST SP 800-227 as an approved KEM but wasn’t selected as one of NIST’s primary PQC standards (that went to CRYSTALS-Kyber, now ML-KEM) — it’s positioned as a conservative, structure-free alternative rather than the default choice.

References

  1. Bos, J., Costello, C., Ducas, L., et al. “Frodo: Take off the Ring! Practical, Quantum-Secure Key Exchange from LWE.” ACM CCS, 2016.

  2. NIST. “Post-Quantum Cryptography Standardization.” Available at: https://csrc.nist.gov/projects/post-quantum-cryptography

  3. FrodoKEM Team. “FrodoKEM: Learning With Errors Key Encapsulation.” Available at: https://frodokem.org/

  4. Regev, O. “On Lattices, Learning with Errors, Random Linear Codes, and Cryptography.” STOC, 2005.