Step by step
The example above, written out — the same steps the animation plays.
- 1Opening https://example.org. Everything you send crosses networks you don't control. TLS makes sure only the real server can read it — and proves it is the real server.
- 2ClientHello. The browser picks a secret a = 6 (never sent) and sends g^a mod p = 5^6 mod 23 = 8.
- 3ServerHello. The server picks its own secret b = 15 and sends 5^15 mod 23 = 19.
- 4Both compute the same key. Browser: 19^6 mod 23 = 2. Server: 8^15 mod 23 = 2. Same key, never sent. With real 256-bit numbers, working it out from 8 and 19 is infeasible.
- 5Certificate (already encrypted). The certificate says "this key belongs to example.org", signed by a certificate authority your browser trusts. CertificateVerify proves the server holds the matching private key.
- 6Browser checks the certificate. Right name (example.org) ✓ · not expired ✓ · signature chains up to a trusted root ✓.
- 7Finished. Each side proves it saw the same handshake. One round trip in total — that is TLS 1.3.
- 8Your request, encrypted. The HTTP request inside is invisible to anyone in between. They can still see which server you connected to — but not what you asked for.
What's happening?
- Browser and server each pick a secret number and exchange only derived public values (Diffie-Hellman).
- Each combines its own secret with the other's public value and gets the same key; an eavesdropper with only the public values cannot.
- The server's certificate, signed by an authority the browser trusts, proves the key really belongs to the site — which is what stops a man-in-the-middle.
Where you'll meet it
Every padlock in the address bar, every API call from an app, and the reason public Wi-Fi can't read your passwords.
Common mistake
Thinking encryption alone is enough. Without checking the certificate, you could have a perfectly encrypted connection to an attacker.
FAQ
Are the numbers here real?
The maths is real; the numbers are tiny so you can check them. Real handshakes use 256-bit elliptic-curve values.
What can someone on the network still see?
Which server you connected to and how much data moved — not the pages, forms or cookies inside.
TLS 1.2 vs 1.3?
TLS 1.3 finishes in one round trip instead of two, encrypts the certificate, and removed weak old ciphers.