← back to crypto

TLS Handshake

Wikipedia (CC BY-SA 4.0) ยท wpTransport Layer Security

TLS (Transport Layer Security) wraps a TCP connection in encryption. The handshake is where client and server agree on keys. It combines everything from the previous chapters: certificates (Ch.8), key exchange (Ch.7), symmetric encryption, and hashing. Every HTTPS connection starts with this dance.

Client Server ClientHello TLS version, cipher suites, client random ServerHello chosen cipher, server random Certificate server's cert chain (public key + CA sigs) ServerKeyExchange ECDH parameters, signed ServerHelloDone ClientKeyExchange client's ECDH public value both derive symmetric session key ChangeCipherSpec + Finished ChangeCipherSpec + Finished encrypted application data

Step by step

Scheme

Why this sequence

The handshake solves three problems at once. Authentication: the certificate proves the server's identity. Key agreement: ECDH establishes a shared secret without transmitting it. Forward secrecy: ephemeral ECDH keys mean that compromising the server's long-term key later does not decrypt past sessions. Each session gets fresh keys that are discarded afterward.

Scheme

Reading a cipher suite

A cipher suite name like TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 tells you the full stack: ECDHE for key exchange, RSA for authentication (the certificate), AES-256-GCM for symmetric encryption, SHA-384 for the PRF.

Component Example Purpose
Key exchangeECDHEEstablish shared secret (Ch.7)
AuthenticationRSAVerify server identity (Ch.8)
Bulk cipherAES_256_GCMEncrypt session data
PRF hashSHA384Key derivation
Neighbors

This series

  • Shannon Ch.7 โ€” channels: TLS creates a secure channel

Foundations (Wikipedia)