Day: February 9, 2026

Uncategorized

PQC ML

Post-Quantum Cryptography (PQC) Basics Quantum computers threaten current public-key algorithms like RSA and ECDH via Shor's algorithm, which factors large numbers or computes discrete logs efficiently. PQC develops algorithms resistant to both classical and quantum attacks. NIST standardized the first set in 2024:

  • ML-KEM for key encapsulation (key exchange).
  • ML-DSA and SLH-DSA for signatures.

This matters for your work in certificate/identity systems: TLS secures credential issuance, revocation, and verification. Migrating to PQC protects against "harvest now, decrypt later" attacks, where adversaries store encrypted traffic today for future quantum decryption.

CRYSTALS-Kyber vs. ML-KEM CRYSTALS-Kyber is the original lattice-based Key Encapsulation Mechanism (KEM) from the CRYSTALS team, submitted to NIST's PQC process. It reached round 3 and won selection in 2022.

NIST standardized it as ML-KEM (Module-Lattice-Based Key-Encapsulation Mechanism) in FIPS 203 (August 2024). ML-KEM derives directly from Kyber (round 3 version) with minor tweaks:

  • Better domain separation in key generation to prevent cross-protocol attacks.
  • Slight changes in seed generation for public values.

They are essentially the same algorithm—many implementations still call it "Kyber," but the official standard is ML-KEM.

How ML-KEM (Kyber) Works It bases security on the Module Learning With Errors (MLWE) problem, a structured lattice problem hard even for quantum computers.

High-level flow:

  1. Key Generation
    • Randomly generate a public matrix A (from a seed).
    • Sample small secret vector s and error e.
    • Public key pk = (A, t), where t ≈ A·s + e (compressed to reduce size).
    • Private key sk includes s.
  2. Encapsulation (Sender)
    • To share a secret with pk holder: sample randomness, compute noisy equations.
    • Output: ciphertext ct (encapsulated key) + shared secret ss (32 bytes).
  3. Decapsulation (Receiver)
    • Use sk to remove noise from ct and recover the same ss.

Security achieves IND-CCA2 via the Fujisaki-Okamoto transform and explicit rejection for invalid ciphertexts. Compression keeps sizes reasonable.

Security levels:

  • ML-KEM-512 → ~AES-128.
  • ML-KEM-768 → ~AES-192 (most common for TLS hybrids).
  • ML-KEM-1024 → ~AES-256.

Public keys ~1-1.5 KB, ciphertexts similar—larger than ECDH but practical.

Co6GC: Introduction to Lattice-based Cryptography (Part 1) - COSIC

esat.kuleuven.be

Kyber KEM

asecuritysite.com

TLS 1.3 Hybrid Key Exchange using X25519Kyber768 / ML-KEM

Let's break down each term one by one, like you're completely new to this. We'll use everyday analogies—no heavy math.

CRYSTALS

  • This is just a project name, not a thing by itself.
  • It stands for Cryptographic Suite for Algebraic Lattices.
  • Think of it like a "brand" or "team name" from a group of researchers who built two quantum-safe tools:
    • Kyber (for key exchange)
    • Dilithium (for digital signatures)
  • So when people say "CRYSTALS-Kyber", they're talking about the Kyber algorithm made by the CRYSTALS team.

Kyber

  • The original name of the algorithm.
  • It's a way for two computers (like a browser and a server) to agree on a secret key over the internet, even if someone is listening.
  • Analogy: Imagine you and a friend want to share a secret password, but you're mailing it through a public post office where spies can read everything. Kyber is like putting the password in a magic box that only your friend can open—even if the spy sees the box.

KEM (Key Encapsulation Mechanism)

  • This is the type of tool Kyber is.
  • Simple definition: A KEM is a secure way to "wrap up" (encapsulate) a random secret key and send it to someone.
  • The sender creates a small package (ciphertext) that contains the secret.
  • Only the person with the private key can unwrap it and get the same secret.
  • Everyone else sees garbage.
  • It's used for key exchange in things like TLS (the "https" lock in your browser).

ML (Module-Lattice)

  • This is the math foundation that makes Kyber secure.
  • "Lattice" = imagine a giant grid of points in many dimensions (like a 3D chessboard but with 512 dimensions). Finding the shortest path on this grid is super hard—even for quantum computers.
  • "Module" = a structured way to build these grids so the math is efficient and fast on normal computers.
  • You don't need to understand the math deeply—it's just why Kyber is believed to be quantum-safe.

Putting It All Together: Kyber → ML-KEM

  • Original research name: CRYSTALS-Kyber
  • NIST (the US standards body) picked it as the winner for quantum-safe key exchange.
  • They renamed the standardized version to ML-KEM (Module-Lattice-based Key Encapsulation Mechanism) and published it as an official standard (FIPS 203) in 2024.
  • So today:
    • Kyber = the original friendly name everyone still uses.
    • ML-KEM = the official government-standard name.
    • They are basically the same thing with tiny safety tweaks.

Why This Matters for Your Job (Certificates & Identity Systems) Certificates are delivered and validated over TLS connections. Right now TLS mostly uses old algorithms (like ECDH) that a big quantum computer could break in the future. Switching the key exchange part to ML-KEM (Kyber) protects credential issuance, enrollment, and revocation against future quantum attacks—especially important for long-lived certificates or sensitive identity systems.

Practical Part – See It in Action (Super Easy)

  1. Real-World Example You Can Try Today Go to a test site that supports hybrid post-quantum TLS: https://pq.cloudflareresearch.com (Cloudflare's PQ test page)
    • Open it in Chrome or Firefox (recent versions).
    • Open Developer Tools → Security tab.
    • You might see "X25519MLKEM768" or similar in the key exchange—this is classical + ML-KEM combined (hybrid mode). This shows a real certificate being delivered over a quantum-safe connection.
  2. Tiny Code Snippet (Python with liboqs-python) If you have Python and want to play locally:Bashpip install liboqs-pythonPythonfrom oqs import KeyEncapsulation # Create ML-KEM-768 (most common level) kem = KeyEncapsulation("ML-KEM-768") # Server generates keys public_key = kem.generate_keypair() # Client encapsulates (sends secret) ciphertext, shared_secret_client = kem.encapsulate(public_key) # Server decapsulates (gets same secret) shared_secret_server = kem.decapsulate(ciphertext) print("Secrets match?" , shared_secret_client == shared_secret_server) # True!Run this script → it prints "True". You've just done a real post-quantum key exchange in ~10 lines.

This is the same mechanism that will protect future certificate transport. Next time you can ask about the signature side (ML-DSA / Dilithium) or how hybrids work in real TLS handshakes!