✍️ Interactive Simulation

CRYSTALS-Dilithium

A lattice-based digital signature scheme — quantum-safe signing standardised by NIST in 2024 as FIPS 204.

✍️
Step 1 — What Is a Digital Signature?
Dilithium proves that a message came from a specific party and was not altered — without revealing the signer's private key.
Digital signatures answer two questions:
1. Authenticity — did this message really come from who claims to have sent it?
2. Integrity — has the message been altered since it was signed?

Dilithium is RSA-signatures' quantum-safe replacement, standardised as NIST FIPS 204 in 2024.
The signing flow:
1. Signer has (pk, sk) key pair
2. Compute σ = Sign(sk, message)
3. Send (message, σ) to verifier
4. Verifier checks Verify(pk, message, σ)
5. Returns ✓ valid or ✗ invalid
Dilithium's math foundation:
▸ Module-LWE + Module-SIS problems
▸ Polynomial ring ℤ_q[x]/(xⁿ+1)
▸ q = 8380417, n = 256
▸ "Fiat-Shamir with Aborts" paradigm
▸ Nonce y chosen fresh per signature
🗝️
Step 2 — Key Generation
Generate a signing key pair. The public key is used to verify; the private key to sign.
Dilithium key structure (toy version):
Matrix A is public and random. Secret vectors s₁, s₂ have small coefficients.
Public key t = As₁ + s₂ (mod q) — hard to reverse into s₁ or s₂ (Module-LWE hardness).
🖊️
Step 3 — Sign a Message
The signer uses their private key and a fresh random nonce to produce a signature (z, c). The message is never sent alone — always with its signature.
Signing: σ = (z, c)
1. Pick random nonce y (small coefficients)
2. Compute w = Ay mod q
3. Hash challenge c = H(pk ‖ message ‖ w)
4. Compute z = y + c·s₁ — if z has large coefficients, abort and retry (keeps s₁ hidden)
5. Output σ = (z, c)
✅
Step 4 — Verify the Signature
The verifier uses only the public key, the message, and the signature (z, c) — they never need the private key.
Verification: check c = H(pk ‖ message ‖ Az − c·t)
Because t = As₁ + s₂ and z = y + c·s₁:
Az − c·t = A(y+cs₁) − c(As₁+s₂) = Ay − cs₂ ≈ w (small error cancels)
So the recomputed challenge should match c exactly.
🔨
Step 5 — Tamper Test
See what happens when an attacker modifies the message or forges a signature. Even a single character change causes verification to fail.
The signature is cryptographically bound to the exact message bytes. Change one character, and the recomputed challenge c′ will not match c — the forgery is detected.
Original message kept. Edit this and re-verify.
Try changing a digit. Verification will fail.
🛡️
Step 6 — Post-Quantum Security
How Dilithium compares to classical signature schemes under quantum attack.
Quantum attacks on classical signatures: Shor's algorithm breaks RSA and ECDSA signatures. Grover's algorithm gives a quadratic speedup but is countered by larger parameters. Dilithium's lattice foundation has no known quantum advantage.
SchemeClassical securityQuantum securitySig sizeBased on
RSA-PSS-2048112-bitBroken256 BFactoring
ECDSA P-256128-bitBroken64 BDiscrete log
EdDSA (Ed25519)128-bitBroken64 BDiscrete log
Dilithium2~100-bit~100-bit2420 BModule-LWE+SIS
Dilithium3~161-bit~161-bit3293 BModule-LWE+SIS
Dilithium5~227-bit~227-bit4595 BModule-LWE+SIS

Deployment status
✓ NIST FIPS 204 (Aug 2024) — official standard
✓ OpenSSL 3.x: Dilithium provider available
✓ Google: testing in Chrome / internal infra
✓ Cloudflare: post-quantum TLS pilots
Trade-offs vs ECDSA
✗ Larger signatures (3293 B vs 64 B)
✗ Larger public keys (1952 B vs 32 B)
✓ Faster signing than RSA
✓ Quantum-safe with current parameters