Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 8 min read Case study hardMaster

Post-quantum readiness for TLS at Meta

Meta has deployed hybrid X25519+Kyber key exchange in its Fizz TLS library for most internal service traffic, prioritizing store-now-decrypt-later protection where it controls both endpoints. Kyber768 is the default, but Kyber512 is used where the larger 1184-byte keyshare pushed resumption ClientHellos (with PSKs) past the TCP MSS and broke TCP Fast Open, adding an extra RTT. Rollout surfaced a race condition in liboqs's Keccak dispatch causing segfaults, fixed upstream with pthread_once, and HelloRetryRequest thrashing during cross-host resumption, solved by splitting TLS session scopes into classical and hybrid. The hybrid group cost about 40% more CPU than X25519 alone.

Assumes: TLS 1.3 handshakeDiffie-Hellman key exchangeTCP Fast Opensession resumption with PSK

Related posts

  • Quantum Resistance and the Signal Protocol

    Signal easyNovice

    Signal is upgrading its X3DH key agreement to PQXDH, which derives the session shared secret from both X25519 elliptic-curve key agreement and the CRYSTALS-Kyber post-quantum key encapsulation mechanism, so an attacker must break both to recover keys. The hybrid design guards against harvest-now-decrypt-later attacks by future quantum computers while hedging against undiscovered weaknesses in newer post-quantum schemes, one of which was broken classically during NIST standardization. PQXDH is already live for new chats between updated clients, X3DH will be disabled for new chats after an update window, and existing chats will be migrated. Protection against an attacker with a contemporaneous quantum computer remains future work.

  • Signal Protocol and Post-Quantum Ratchets

    Signal hardMaster

    Signal adds the Sparse Post Quantum Ratchet (SPQR), a continuously advancing ML-KEM-based ratchet whose output is mixed with the existing Double Ratchet to form a "Triple Ratchet". It extends quantum resistance beyond PQXDH's session handshake to forward secrecy and post-compromise security. KEM key exchange needs ordered, asymmetric messages, and ML-KEM 768 keys and ciphertexts each exceed 1000 bytes versus 32 for ECDH. SPQR handles this with a state machine that coordinates encapsulation-key and ciphertext exchange, and with erasure-coded chunks spread across messages. The chunking keeps message sizes small and uniform and tolerates loss, reordering and offline peers. It also forces an attacker who wants to block key agreement into an obvious denial of service. Rollout requires no user action.

  • Post-quantum security for SSH access on GitHub

    GitHub Engineering mediumAdept

    GitHub is adding the hybrid post-quantum SSH key exchange sntrup761x25519-sha512 (Streamlined NTRU Prime combined with X25519 ECDH) to its Git SSH endpoints on September 17, 2025. The goal is to defend against "store now, decrypt later" attacks. Because the scheme is hybrid, security is never weaker than classical X25519. The change covers github.com, non-US GitHub Enterprise Cloud regions and GHES 3.19, but not the FIPS-only US region. Clients running OpenSSH 9.0+ negotiate it automatically, older clients fall back, and `ssh -Q kex` or `ssh -v` shows support and the negotiated algorithm.

  • Enforcing encryption at scale

    Meta Engineering hardMaster

    Meta enforces TLS on internal service traffic with SSLWall, a host-level daemon plus eBPF programs that detect and cut off plaintext connections, chosen over L7 firewalls to keep the blast radius small and allow fine-grained rollout. It combines a tc-bpf filter, kprobes on tcp_connect and tcp_v6_destroy_sock, and BPF maps. It supports a passive monitoring mode, bypasses for BGP/SSH, and plaintext-then-TLS flows like STARTTLS and HTTP CONNECT. Lessons included handling TCP Fast Open ordering via kprobe prehandlers, BPF program size limits, and keeping CPU overhead trivial with early exits and arrays instead of LRU maps. For noncompliant long-tail apps, Transparent TLS uses a cgroup/connect6 BPF hook to redirect connect() calls to a local encrypting proxy, skipping connections that already use TLS.

  • How Meta built large-scale cryptographic monitoring

    Meta Engineering mediumAdept

    Meta logs every operation in FBCrypto, its managed cryptographic library, without sampling by aggregating identical events into per-event counts in an in-process buffer and flushing them periodically to Scribe, with data landing in Scuba and Hive. The buffer is a folly::ConcurrentHashMap shared across threads. Randomized first-flush delays smooth write spikes, and derived-key operations are rolled up under the parent key name to cut volume while still giving a pessimistic count for detecting key overuse. The resulting dataset drives key rotation, inventories of weak and quantum-vulnerable algorithms for migration, migration-safety alarms based on success rates, and fleet-wide library version tracking. Remaining challenges include Scribe and Scuba capacity and flushing safely at shutdown.

The quest for software engineering knowledge.

Look:
Layout: