Back to DashboardProtocolsPhase 5 · Pilots & Migrationadvanced60 min

VPN/IPsec & SSH PQC

Explore post-quantum key exchange in IKEv2, SSH, and WireGuard protocols.

Why this matters: IKEv2 and SSH key exchange are two of the most widely deployed protocols on earth — hybrid ML-KEM key exchange (mlkem768x25519-sha256) was added in OpenSSH 9.9 and made the default in OpenSSH 10.0, making this one of the more immediately actionable PQC migrations.

Start here: Choose a key exchange mode — Classical, Hybrid or Pure PQC — and an ML-KEM size, then press Start Daemon: a real IKEv2 exchange runs between initiator and responder, phase by phase in the diagram.

For your role

Developer / Engineer
Step through IKEv2 in Classical, Hybrid and Pure PQC modes, compare SSH key exchange with curve25519, sntrup761 and mlkem768, and compare IKEv2, SSH, WireGuard and TLS 1.3 sizes and round trips.
Researcher / Academic
The protocol comparison of sizes, RTTs and features across IKEv2, SSH, WireGuard and TLS 1.3 is the measurement; the VPN and SSH simulators produce the packets.
IT Ops / DevOps
The IKEv2 modes and the SSH KEX comparison are what your VPN and SSH configurations will carry; the simulators produce the strongSwan config and the sshd changes.
Practice in the Simulation

IKEv2 Handshake Overview

(Internet Key Exchange version 2, RFC 7296) is the key negotiation protocol for VPNs. It establishes Security Associations (SAs) through a two-phase handshake: IKE_SA_INIT for key exchange and IKE_AUTH for identity verification.

Initiator
— Phase 1 —
Responder
SA, KE, Ni →
IKE_SA_INIT
← SA, KE, Nr
SK{IDi, AUTH} →
IKE_AUTH
← SK{IDr, AUTH}

The KE payload carries public values. Both parties derive the same shared secret (SKEYSEED) from their DH exchange, nonces, and SPIs, then derive encryption and integrity keys for the IKE SA.

in IKEv2

The IETF draft draft-ietf-ipsecme-ikev2-mlkem defines how to integrate ML-KEM () into IKEv2 using the multiple key exchanges framework (RFC 9370). This enables hybrid key exchange while limiting the changes to the exchanged messages and the IKEv2 state machine (RFC 9370).

“The initiator generates an ML-KEM keypair (pk, sk) using KeyGen(), and sends the public key (pk) to the responder inside a KEi(1) payload. The responder will encapsulate a shared secret ss using Encaps(pk) and the resulting ciphertext (ct) is sent to initiator using the KEr(1).”

— draft-ietf-ipsecme-ikev2-mlkem-09, Appendix A

Classical DH

ECP-256 or MODP-2048 in KE payload during IKE_SA_INIT. Quantum-vulnerable.

Additional key exchange (RFC 9370)

ML-KEM-768 encapsulation key (1,184 B) in IKE_INTERMEDIATE. Adds one round trip.

Combined Secret

SKEYSEED derived from both DH and KEM shared secrets via PRF. The keys stay secret as long as either exchange is unbroken, provided the PRF acts as a sound combiner.

Pure ML-KEM in IKEv2: Known Limits

A pure (quantum-resistant-only) IKEv2 handshake has no classical key exchange to fall back on, so ML-KEM must travel in the very first message, IKE_SA_INIT. That is where the draft's main restriction sits: IKEv2 fragmentation (RFC 7383) only works on encrypted messages, and IKE_SA_INIT is sent before any keys exist. In the draft's words, these messages “could not be IKEv2 fragmented”. A payload bigger than the path MTU falls back to IP fragmentation, which NATs and firewalls often drop and which is a known denial-of-service target.

Parameter setKE payload (key / ciphertext)Pure PQC in IKE_SA_INIT over UDP
ML-KEM-512 (35)808 / 776 BMAY be used
ML-KEM-768 (36)1,192 / 1,096 BSHOULD NOT over UDP without PMTU discovery when the path MTU is unknown, unless IKE runs over TCP
ML-KEM-1024 (37)1,576 / 1,576 BSHOULD NOT over UDP without PMTU discovery when the path MTU is unknown, unless IKE runs over TCP
The CNSA 2.0 squeeze

CNSA 2.0 lists ML-KEM-1024 for key establishment. The draft says ML-KEM-512 MAY be used in IKE_SA_INIT as a quantum-resistant-only key exchange; implementations transporting IKE over UDP and not performing PMTU discovery SHOULD NOT use ML-KEM-768 or ML-KEM-1024 in IKE_SA_INIT on networks where the PMTU is unknown or restricted, and MAY use any ML-KEM parameter when reliable transport (for example RFC 9329) is used or a sufficient PMTU is guaranteed.

The draft's own way round

Appendix A runs a classical exchange in IKE_SA_INIT and carries ML-KEM-768/1024 in IKE_INTERMEDIATE (RFC 9242 / RFC 9370). Those messages are encrypted, so RFC 7383 fragmentation applies. The cost: the first exchange is no longer quantum-resistant on its own. That makes this a hybrid design, not pure PQC.

The draft also requires a fresh ML-KEM key pair and fresh encapsulation randomness for every exchange. The responder must check the initiator's encapsulation key (FIPS 203 §7.2) before encapsulating, and should reject a bad key with INVALID_SYNTAX to limit resource-exhaustion attacks. The draft further warns that an on-path attacker with a quantum computer could steer peers onto a classical-only group unless local policy forbids one. None of this makes the draft a dead end. It sits in the RFC Editor queue, and several firewall vendors already ship hybrid ML-KEM IKEv2. Only pure-PQC IKEv2 at the higher security levels over plain UDP remains an open engineering problem.

Key Exchange with

OpenSSH has been a pioneer in deploying post-quantum key exchange. Since version 8.5 (March 2021), it has shipped with sntrup761x25519-sha512 — a hybrid of Streamlined NTRU Prime and X25519 (default from 9.0). In OpenSSH 9.9 (September 2024), mlkem768x25519-sha256, OpenSSH’s hybrid of ML-KEM-768 (FIPS 203, standardised by NIST) and X25519, was added, and in OpenSSH 10.0 (April 2025) it became the default key exchange.

OpenSSH 8.5
sntrup761x25519-sha512
Available (2021)
OpenSSH 9.0
sntrup761x25519-sha512
Default (9.0–9.9) (2022)
OpenSSH 9.9
mlkem768x25519-sha256
Available (2024)
OpenSSH 10.0
mlkem768x25519-sha256
Default (10.0+) (2025)

SSH hybrid KEX works by concatenating the classical and PQC public keys in SSH_MSG_KEX_ECDH_INIT, and concatenating the classical share and KEM ciphertext in SSH_MSG_KEX_ECDH_REPLY. The shared secret is derived from both components.

& PQC

WireGuard uses the Noise IK protocol framework with a fixed cipher suite: , ChaCha20-Poly1305, BLAKE2s. This minimal design makes WireGuard fast and auditable, but also means it has zero — algorithms cannot be negotiated.

The Challenge

WireGuard's fixed X25519 is quantum-vulnerable. Adding PQC requires modifying the protocol or layering a separate negotiation on top.

Rosenpass Solution

runs a separate post-quantum key exchange (Classic McEliece for the static keys, the round-3 Kyber for the ephemeral keys — not FIPS 203 ML-KEM) and feeds the resulting PSK into WireGuard's pre-shared key slot.

Rosenpass Daemon (Classic McEliece-460896 + Kyber-512)
↓ PSK
WireGuard (X25519 + ChaCha20-Poly1305 + PSK)
↓
Tunnel Protected: Classical + PQC

The Rosenpass approach preserves WireGuard's simplicity while adding quantum resistance. The PSK is rotated periodically. WireGuard's classical security holds even if Rosenpass is compromised; the post-quantum protection does not.

Protocol Size Impact

Post-quantum key exchange significantly increases handshake sizes across all protocols. ML-KEM-768 adds approximately 1,184 bytes for the encapsulation key and 1,088 bytes for the ciphertext. For protocols like WireGuard that use UDP, this can cause IP fragmentation issues.

ProtocolClassicalHybridIncrease
IKEv21,400 B3,784 B+170%
SSH984 B3,296 B+235%
TLS 1.31,200 B3,500 B+192%

Sizes are this workshop's message model, not packet captures. WireGuard is not in the table: adding post-quantum protection with Rosenpass means four extra Rosenpass messages, InitHello 1,092 B, RespHello 1,132 B, InitConf 176 B and EmptyData 64 B, 2,464 B in total (Rosenpass white paper, Figure 2). The paper gives no comparison with WireGuard's own handshake, so none is stated here. Rosenpass's large McEliece public keys are exchanged out of band, not in the handshake. IKEv2 handles fragmentation explicitly (RFC 7383) over UDP, but only for encrypted messages, so it cannot help IKE_SA_INIT. SSH handles larger payloads natively because it relies on TCP transport.

Authentication: The Missing Half

While PQC Key Exchange (ML-KEM) secures connections against future decryption, Authentication using secures against active attackers. Both IKEv2 and SSH uniquely require multiple layers of authentication that must be migrated.

IKEv2 (IKE_AUTH)

In addition to the additional key exchanges, draft-ietf-ipsecme-ikev2-pqc-auth updates the IKE_AUTH phase to support (). The Auth payload verifies identities using post-quantum certificates.

SSH Host & User Auth

SSH requires PQC host keys (server identity) and user keys (UserAuth). While OpenSSH 9.9 supports ML-KEM, standardizing ML-DSA keys for host and user authentication is still an active effort.

Control Plane vs. Data Plane

The migration to PQC only applies to the Control Plane (key exchange & auth). The actual Data Plane (the VPN tunnel) uses symmetric algorithms like AES-GCM or ChaCha20-Poly1305. The data plane’s symmetric algorithms are affected by Grover’s algorithm rather than Shor’s; per NIST (cited in RFC 9370), applications can continue using AES with a minimum key length of 128 bits, and a longer key size can be considered for data that must remain secure for many years.

Related Resources

Step through IKEv2 and SSH handshakes, compare classical vs hybrid vs pure PQC modes.

Products shown here are a representative selection — not an exhaustive list. For the full vendor landscape with PQC readiness status, visit the Tools & Products tab in this module or browse the Migrate catalog →

Check off all sections and mark this reading done.

In the Industry Landscape

Check your understanding

11 questions on VPN/IPsec & SSH, each with its answer and the reason.

Take the quiz

Next step

Practice it: PQC VPN Simulator

PQC VPN Simulator is the hands-on version of this module: the same ideas, run in your browser.

Production Tool Capabilities & Verification Checklist

Capabilities to require in your production tools:

  • IKEv2 Multiple Key Exchanges (RFC 9370 `ADDKE1..ADDKE7`) with `ML-KEM-768` / `ML-KEM-1024` (draft-ietf-ipsecme-ikev2-mlkem). Check RFC 7383 IKE fragmentation for message-size limits and RFC 9329 TCP encapsulation for paths that block UDP.
  • OpenSSH 9.9+ hybrid key exchange (`mlkem768x25519-sha256` or `sntrup761x25519-sha512`) enforced via `KexAlgorithms` in `sshd_config`.
  • PQC X.509 or raw public key authentication for site-to-site and remote-access VPN tunnels.

How to evaluate in your environment

Inspect `swanctl --list-sas` for `IKEv2 ADDKE` transform negotiation and run `ssh -vvv` to verify `mlkem768x25519-sha256` selection.

Production evidence to collect

VPN security-association (`SA`) status dump, `sshd -T` effective configuration output, and negative KEX rejection logs.

Completing this Hub module and its browser-based sample exercises teaches the technical and governance decision criteria for your role; it does not test, validate, or certify your deployed production systems.

Record evidence for your environment

Identify the tested build and configuration. Use reference IDs for observations. For a proposed exclusion, record the system boundary or rule and why it excludes this build.

IKEv2 Multiple Key Exchanges (RFC 9370 `ADDKE1..ADDKE7`) with `ML-KEM-768` / `ML-KEM-1024` (draft-ietf-ipsecme-ikev2-mlkem). Check RFC 7383 IKE fragmentation for message-size limits and RFC 9329 TCP encapsulation for paths that block UDP.
OpenSSH 9.9+ hybrid key exchange (`mlkem768x25519-sha256` or `sntrup761x25519-sha512`) enforced via `KexAlgorithms` in `sshd_config`.
PQC X.509 or raw public key authentication for site-to-site and remote-access VPN tunnels.

Evidence missing. 0 of 3 requirements have a reference or scope rationale.

Learning module content can be inaccurate. Please double-check its information. Report inaccuracies in PQC Today GitHub Discussions.