PQ ALFTECH / STUDIES ↗
◌ Post-quantum cryptography / working demo 03

Locked against
tomorrow's computer.

The encryption a quantum computer cannot break — running on this phone, step by step. ML-KEM-768, the NIST standard since 2024, implemented from the text of the standard.

Run a key exchange ↓ A working demo for DeepTech Ventures Luxembourg · September 2026

Three steps. One secret.

Alice makes a key pair. Bob locks a fresh secret to her public key. Alice unlocks it with her private key. Then flip one byte of what Bob sent and watch it fail silently.

ML-KEM-768 · FIPS 203NOT RUN YET
1 · Alice
Alice makes a key pair
2 · Bob
Bob locks a secret to her public key
3 · Alice
Alice unlocks it with her private key

Now say something.

The shared secret becomes an AES-256 key. Type anything; it is encrypted on Bob's side and decrypted on Alice's.

encrypted
—
decrypted
—
SchemePublic keyCiphertextQuantum computer
RSA-2048256 B256 Bbreaks it (Shor, 1994)
X25519 (elliptic curve)32 B32 Bbreaks it (Shor, 1994)
ML-KEM-7681184 B1088 Bno known attack

Bigger keys are the price. Chrome, Firefox and Cloudflare already pair X25519 with ML-KEM-768 in TLS — so the connection to this very page may have used it.

01

Lattices

RSA rests on factoring, elliptic curves on discrete logs — a quantum computer solves both with Shor's algorithm. ML-KEM rests on a different problem: given a matrix A and A·s + e with small noise e, find s. No quantum algorithm is known to do that faster than a classical one.

⋰
02

The standard

FIPS 203, published by NIST in August 2024, after a six-year open competition. This page implements it line by line: Keccak, arithmetic in Z₃₃₂₉, the number-theoretic transform, sampling, compression, K-PKE, the KEM with implicit rejection.

◫
03

Checked

Six deterministic seeds through this code and through an independent implementation: public keys, private keys, ciphertexts and shared secrets agree byte for byte. SHA-3 and SHAKE match the standard's test vectors. A full exchange takes about 50 ms here.

↗

What this is not Demonstration code, so you can see every step. It has no constant-time guarantees and no audit. For anything real, use a vetted library or the browser's own crypto once it ships ML-KEM.

Sizes: public key 1184 bytes, private key 2400, ciphertext 1088, shared secret 32 — exactly as FIPS 203 specifies for ML-KEM-768.

No server, no request after the page is open. Keys are made here and die with the tab.

A standard, not a speculation

Keys born here.
Keys die here.

Start a conversation ↗
Aleksandr Fedorov
github.com/alexff91