Key Exchange in TLS
TLSv1.2 & TLSv1.3 with Post-Quantum Cryptography (PQC)
Why PQC changes the key exchange
Threat model (high-level)
- Classical public-key cryptography (e.g., RSA, and ECC schemes used in Diffie–Hellman/ECDHE) could become vulnerable if large-scale quantum computers can run relevant quantum algorithms.
- TLS key exchange establishes the shared secret used to derive:
- symmetric session keys (encryption keys),
- integrity keys (MAC/AEAD),
- and traffic keys for the session.
PQC approach in TLS
Because TLS key exchange produces critical session secrets, PQC deployment commonly uses:
- Hybrid key exchange: combine a classical key agreement (for immediate compatibility/security) with a post-quantum KEM-based key agreement (for quantum resilience).
- A typical design goal: if either component remains secure, the resulting shared secret remains secure (often via “key combining” and KDF usage).
TLS 1.2 Key Exchange: baseline (no PQC)
Common TLS 1.2 key exchange modes
TLS 1.2 can use multiple key exchange patterns:
- RSA key transport (server encrypts a premaster secret with client’s RSA public key)
- (EC)DHE / ECDHE key agreement (forward secrecy)
- Variants using different certificate/key exchange combos
For “key exchange process” with forward secrecy, the relevant one is usually (EC)DHE/ECDHE.
TLS 1.2 with (EC)DHE (typical handshake flow)
Goal: agree on a premaster secret / shared secret, then derive session keys.
- ClientHello
- Client proposes cipher suites and supported parameters.
- ServerHello + Certificate
- Server selects a cipher suite.
- Server sends its certificate (identity) and public key info.
- ServerKeyExchange
- Server provides key agreement material (e.g., ephemeral Diffie–Hellman public value).
- This message is typically signed (or otherwise authenticated) to bind the key exchange to the server identity.
- ClientKeyExchange
- Client sends its ephemeral key agreement public value (e.g., its ECDHE share).
- ChangeCipherSpec / Finished
- Both sides compute the shared secret.
- Apply TLS 1.2 PRF / key schedule to derive:
- encryption keys,
- MAC keys,
- IVs/nonces,
- Verify Finished messages to ensure integrity of the handshake.
Security properties
- With (EC)DHE: forward secrecy (compromise of long-term keys later shouldn’t reveal past sessions).
- Integrity/authentication come from:
- server authentication (certificates),
- signature/authentication of ephemeral key material.
TLS 1.2 with PQC (conceptual hybrid key exchange)
Where PQC fits in TLS 1.2
TLS 1.2 does not have a standardized “PQC key schedule” inside the core spec the way TLS 1.3 is structured. So PQC integration in TLS 1.2 is typically described as:
- Use a PQC Key Encapsulation Mechanism (KEM) to derive a shared secret.
- Combine it with a classical (EC)DHE shared secret (hybrid).
- Feed the combined secrets into the existing TLS 1.2 key derivation (PRF) or an equivalent KDF/combining step (implementation dependent).
Hybrid handshake flow (high-level)
Assume:
- Classical ephemeral key agreement: produces
Z_classical - PQC KEM: produces
Z_pqc - Combined secret:
Z_hybrid = Combine(Z_classical, Z_pqc)
Process mapping into TLS 1.2 messages:
- ClientHello
- Client advertises PQC-capable ciphers / extensions.
- ServerHello + Certificate
- Same role: server identity.
- ServerKeyExchange
- Contains classical ephemeral parameters (for (EC)DHE)
- Plus PQC KEM-related public/offer material (as defined by the PQC/TLS integration design).
- ClientKeyExchange
- Client sends:
- its classical ephemeral share
- PQC encapsulation output (or the encapsulated key material, depending on KEM direction)
- Client sends:
- Shared secret computation
- Both compute:
Z_classicalfrom classical ephemeral sharesZ_pqcvia PQC KEM decapsulation (client) / decapsulation (server) as appropriate
- Compute
Z_hybrid
- Both compute:
- Key derivation
- Derive traffic keys (TLS 1.2 PRF / KDF stage) from
Z_hybrid
- Derive traffic keys (TLS 1.2 PRF / KDF stage) from
- Finished
- Verify handshake integrity.
Key point for TLS 1.2 writing
When you explain TLS 1.2 + PQC, emphasize:
- TLS 1.2 key exchange messages (ClientKeyExchange / ServerKeyExchange) are the “hook points.”
- The shared secret derivation becomes hybrid.
- The rest of TLS 1.2 (ChangeCipherSpec/Finished) is conceptually similar, but keys come from the combined secret.
TLS 1.3 Key Exchange: baseline (no PQC)
What is different in TLS 1.3
TLS 1.3 uses a more structured handshake and derives secrets via a standardized key schedule (HKDF-based). It typically uses:
- (EC)DHE for forward secrecy (selected via cipher suite / key_share)
- certificates for authentication (server-side, plus optional client auth)
- a key schedule that produces traffic secrets from handshake secrets
TLS 1.3 handshake flow (key exchange perspective)
- ClientHello
- Includes:
supported_versions- signature algorithms
- key_share entries (client ephemeral public keys for selected groups)
- Includes:
- ServerHello
- Includes:
- chosen group
- server’s key_share ephemeral public key
- Includes:
- EncryptedExtensions / Certificate / CertificateVerify
- Server authenticates its identity (certificate + signature over handshake transcript)
- (Client may also authenticate)
- For mutual TLS, client sends certificate + signature
- Finished
- Keys are derived from shared secret computed from ephemeral shares:
Z_classical = DH(client_share, server_share)
- TLS 1.3 HKDF key schedule derives:
- handshake traffic keys,
- then application traffic keys after handshake completion.
- Keys are derived from shared secret computed from ephemeral shares:
Security properties
- Strong forward secrecy via ephemeral (EC)DHE.
- Transcript binding via Finished + signature over transcript (CertificateVerify).
TLS 1.3 with PQC (hybrid KEM + DHE concept)
Where PQC maps in TLS 1.3
TLS 1.3 is generally easier to extend with PQC because its handshake already centers around:
- “shared secret” creation,
- then a standardized HKDF key schedule.
In PQC hybrid designs:
- Classical: ECDHE provides
Z_classical - PQC: a KEM provides
Z_pqc - Combine to
Z_hybrid(or feed both into a key schedule mechanism), then HKDF derives traffic secrets.
Hybrid handshake flow (high-level)
- ClientHello
- Client includes:
- classical
key_share(ECDHE) - PQC key encapsulation/offer parameters (depending on how PQC is expressed in TLS extensions)
- classical
- Client includes:
- ServerHello
- Server selects both:
- classical group
- PQC KEM parameters/mode
- Server sends:
- its classical ephemeral key_share
- its PQC KEM response (or the extension requires)
- Server selects both:
- Compute hybrid secrets
- Client computes:
Z_classicalfrom ECDHE sharesZ_pqcby decapsulating PQC KEM material
- Server computes:
Z_classicalfrom ECDHE sharesZ_pqcfrom its KEM decapsulation counterpart
- Combine:
Z_hybrid = Combine(Z_classical, Z_pqc)
- Client computes:
- Key schedule (HKDF)
- TLS 1.3 derives handshake and application traffic secrets from the hybrid shared material.
- Authentication + Finished
- Certificate and CertificateVerify ensure authentication.
- Finished confirms both sides derived the same keys.
Key point for TLS 1.3 writing
When you explain TLS 1.3 + PQC, emphasize:
- TLS 1.3 already has the “plumbing” of secret derivation via HKDF.
- PQC integration mostly changes:
- how the shared secret(s) are created,
- and how those feed into the key schedule.
Comparison summary: TLS 1.2 vs TLS 1.3 + PQC
Column 1 | Column 2 | Column 3 |
Structural key schedule | More tied to TLS 1.2 PRF + legacy message flow | HKDF-based key schedule, cleaner extension points |
Where PQC “plugs in” | ServerKeyExchange / ClientKeyExchange as practical insertion points | ClientHello/ServerHello + extensions carry hybrid material |
Forward secrecy | Typically depends on (EC)DHE mode used | Usually inherent via (EC)DHE; hybrid adds PQC resilience |
How secrets are derived | Hybrid shared secret combined then fed into TLS 1.2 derivation | Hybrid shared secret(s) feed into TLS 1.3 HKDF derivation |
Implementation complexity | Often higher due to legacy structure | Often lower due to standardized key schedule model |
Practical considerations (what readers should know)
- Negotiation: client and server must agree on:
- classical group(s),
- PQC KEM(s),
- hybrid combination rules.
- Message size: PQC keys/ciphertexts can increase:
- handshake sizes,
- latency and bandwidth usage.
- Certificate vs key exchange: PQC key exchange typically focuses on:
- secrecy of session keys,
- not necessarily replacing signatures/cert formats (though some PQC deployments do address both).
- Long-term security: the motivation is “store now, decrypt later” risk reduction.