Skip to main content

Workspace

FrodoKEM-640

Unstructured LWE Lattice Cryptography

FrodoKEM Interactive Matrix Visualizer

Explore Learning With Errors (LWE) matrix mathematics and contrast FrodoKEM with ML-KEM (Kyber).

Real FrodoKEM-640 uses 640×640 matrices

Discrete noise added for LWE security

Encoded into matrix hints

Learning With Errors (LWE) Key Generation Formula:B = A × S + E (mod q)

Public Key matrix B is calculated by multiplying public matrix A with secret matrix S, then adding discrete noise matrix E. Without noise E, finding S would be easy using Gaussian elimination. With noise E, it becomes computationally intractable (LWE problem).

Public Matrix A4×4

Pseudorandomly generated from seed_A

12673
23788
13147
20734
17477
26848
1727
25874
16713
23060
32355
20582
11405
25736
15943
26362
Secret Matrix S4×4

Private key sampled from discrete Gaussian noise

-2
-2
0
-2
-1
0
0
-1
1
0
-1
-2
2
-1
1
-1
Noise Matrix E4×4

Small error terms added to mask the product

2
1
0
-1
1
1
0
-1
2
1
0
2
-2
-1
-1
0
A × S + E (mod 32768) = Public Key B
Public Key Matrix B4×4

Transmitted to sender for key encapsulation

5483
19457
7587
2141
24442
4709
24147
7173
17035
11529
20995
22064
20119
16363
10418
24278

Recommended Next Step

Continue your cryptography learning path