Skip to content
CryptographyInternals

10 / 11 · Modern cryptography

TLS 1.3 handshake

How your browser and a server agree on keys, check identity and start encrypting, in one round trip.

Standard
RFC 8446, August 2018
Round trips
1 (TLS 1.2: 2)
Combines
ECDHE, signatures, HKDF, AES-GCM

TLS is the protocol behind every HTTPS padlock. Version 1.3, published by the IETF as RFC 8446 in August 2018, rebuilt the handshake: fewer messages, no legacy algorithms, and encryption that starts right after the server's first reply.

The handshake is where the other topics meet. An elliptic-curve Diffie–Hellman exchange creates a shared secret, a signature proves the server's identity, hashes bind every message together, and AES-GCM encrypts the traffic. The journey below follows the example handshake published in RFC 8448, byte for byte.

The padlock
ClientServerplaintext
?
private key
?
?
shared secret
?
?
handshake
?
?
app traffic
?
Zoom on the message
X25519 · agree on a secret+Signature · prove who you are+SHA-256 · HKDF · derive keys+AES-GCM · encrypt

01 / 17 · Inside TLS 1.3

What happens behind the padlock

Before an https:// page loads, your browser (the client) and the server agree on secret keys, check the server’s identity and start encrypting. TLS 1.3 does it in one round trip, a message out and one back, with four building blocks.

Without TLS, anyone on the path (café Wi-Fi, a router, an internet provider) can read and change everything you send.

How it works

  1. 1The client sends ClientHello: the cipher suites it supports, a 32-byte random value and a key share, its ephemeral X25519 public key.
  2. 2The server answers with ServerHello: the cipher suite it chose and its own key share. Both sides compute the same shared secret, and HKDF derives handshake traffic keys from it and from the hash of the two hellos.
  3. 3Encrypted under those keys, the server sends EncryptedExtensions, its Certificate, CertificateVerify (a signature over the transcript hash) and Finished (an HMAC over the transcript).
  4. 4The client checks the certificate chain, the signature and the MAC, then sends its own Finished. Both sides switch to application traffic keys, and HTTP flows under AES-GCM or ChaCha20-Poly1305.

Why it holds

Forward secrecy
TLS 1.3 only allows ephemeral (EC)DHE key exchange; static RSA key exchange was removed. Session keys come from secrets erased after the handshake, so stealing the server's private key later does not decrypt recorded traffic.
Signed transcript
CertificateVerify signs a hash of every handshake message so far. An attacker who swaps a key share or downgrades a cipher suite changes that hash, and cannot produce a valid signature without the server's private key.
Only authenticated encryption
All five TLS 1.3 cipher suites use AEAD: AES-GCM, ChaCha20-Poly1305 or AES-CCM. CBC modes, RC4, compression and renegotiation, behind many attacks on earlier versions, are gone.

What can go wrong

0-RTT can be replayed
Resumed connections may send early data in the very first flight, before the handshake completes. That data has no protection against replay, so servers should accept it only for requests that are safe to repeat.
Trust and quantum computers
TLS is only as trustworthy as the certificate authorities browsers accept. And a large quantum computer would break X25519, so traffic recorded today could be decrypted later: browsers and servers are rolling out the hybrid X25519MLKEM768 key exchange.