ML-KEM (Module-Lattice Key Encapsulation Mechanism), formerly CRYSTALS-Kyber, won NIST's 6-year post-quantum standardisation competition. Standardised as FIPS 203 in August 2024.
Mathematical basis: Module Learning With Errors (MLWE). Given a matrix A and vector b = As + e (where s is a secret vector, e is small random noise), recovering s is computationally hard — even for quantum computers. No known quantum speedup beyond the generic square-root Grover speedup.
Three security levels:
- ML-KEM-512: ~128-bit classical, ~equivalent to AES-128
- ML-KEM-768: ~192-bit classical, recommended for most uses
- ML-KEM-1024: ~256-bit classical, high-security applications
Key and ciphertext sizes (ML-KEM-768):
- Public key: 1184 bytes (vs X25519: 32 bytes)
- Secret key: 2400 bytes
- Ciphertext: 1088 bytes (vs X25519: 32 bytes)
- Shared secret: 32 bytes (same)
The large key/ciphertext sizes are the main practical downside. For Q-Safe on RP2040, the sizes fit comfortably in RAM and the latency is acceptable — ML-KEM operations are fast (~200μs on Cortex-M4 at 120MHz for encapsulate/decapsulate).
Why Kyber won: Fast operations, relatively small key sizes among lattice schemes, clean and analysable design, good constant-time implementation properties (important for side-channel resistance).