This cheat sheet covers the TLS handshake, the process that lets a browser and server create a secure connection before exchanging private data. Students need it because HTTPS, APIs, online banking, and many secure apps depend on TLS. Understanding the handshake helps explain how encryption, authentication, and integrity work together on the web.
The most important ideas are certificate verification, key exchange, shared secret creation, and symmetric session encryption. Modern TLS, especially TLS 1.3, uses ephemeral Diffie-Hellman to create fresh session keys. The client verifies the server certificate using a trusted certificate authority, then both sides derive matching keys without sending the secret itself.
Key Facts
- TLS protects data using confidentiality, integrity, and authentication between a client and a server.
- The handshake starts with ClientHello, which sends supported TLS versions, cipher suites, random data, and key share information.
- The server replies with ServerHello, selecting the TLS version, cipher suite, random data, and its key share.
- A server certificate binds a domain name to a public key and must be signed by a trusted certificate authority.
- Certificate verification checks that the certificate is not expired, matches the domain, chains to a trusted CA, and has a valid signature.
- In Diffie-Hellman key exchange, both sides compute the same shared secret using their private key and the other side's public key.
- A simplified key derivation rule is session keys = KDF(shared secret, client random, server random).
- After the handshake, application data is encrypted with faster symmetric encryption such as AES-GCM or ChaCha20-Poly1305.
Vocabulary
- TLS
- Transport Layer Security is a protocol that secures network communication using encryption, authentication, and integrity checks.
- Handshake
- A handshake is the setup process where the client and server agree on security settings and create shared session keys.
- Certificate
- A certificate is a digitally signed document that connects a website's identity to its public key.
- Certificate Authority
- A certificate authority is a trusted organization that signs certificates to help prove that a public key belongs to a real domain.
- Key Exchange
- Key exchange is the method used by two parties to create a shared secret over an insecure network.
- Session Key
- A session key is a temporary symmetric key used to encrypt and decrypt data during one secure connection.
Common Mistakes to Avoid
- Confusing TLS with HTTPS is incorrect because HTTPS is HTTP running over TLS, while TLS is the security protocol itself.
- Assuming the certificate encrypts all data is wrong because the certificate mainly proves identity and provides a public key for authentication.
- Thinking the shared secret is sent across the network is wrong because Diffie-Hellman lets both sides compute it without transmitting it.
- Ignoring certificate validation is dangerous because encryption without authentication can still allow a man-in-the-middle attack.
- Mixing up asymmetric and symmetric encryption is a common error because TLS uses asymmetric methods during setup but usually uses symmetric encryption for the actual data.
Practice Questions
- 1 A browser receives a certificate for example.com, but the user visited bank.example.com. What certificate name check could fail, and why?
- 2 A TLS 1.3 connection uses a client random, a server random, and a shared secret. Write the simplified key derivation expression for the session keys.
- 3 If a certificate expires on 2026-04-01 and today's date is 2026-05-10, should the browser trust it? Explain the validation rule.
- 4 Why does TLS use symmetric encryption after the handshake instead of using public key encryption for all application data?