What does HTTPS add on top of HTTP? Explain, at a high level, what happens during a TLS handshake, why both asymmetric and symmetric cryptography are used, and how the browser knows it is talking to the real server.
Show hints
Separate the problem of agreeing on a key from the problem of encrypting bulk data.
Show the explanation
Model answer. HTTPS is HTTP sent over a TLS (Transport Layer Security) connection, typically on TCP port 443. TLS provides three guarantees:
- Confidentiality — eavesdroppers cannot read the content.
- Integrity — tampering in transit is detected.
- Authentication — the client can verify the server's identity (and optionally the server can verify the client's).
TLS 1.3 handshake (simplified, one round trip)
- ClientHello: supported TLS versions and cipher suites, a random value, and a key share for an ephemeral (EC)Diffie–Hellman exchange. The Server Name Indication (SNI) extension tells the server which site is wanted.
- ServerHello: the chosen cipher suite and the server's own key share. Both sides can now compute the same shared secret and derive symmetric session keys; everything after this point is encrypted.
- The server sends its certificate, a CertificateVerify signature made with its private key (proving it owns the certificate), and a Finished message.
- The client verifies all of this, sends its own Finished, and HTTP data flows encrypted. (TLS 1.2 needed two round trips for a full handshake.)
Why both kinds of cryptography?
- Asymmetric operations (Diffie–Hellman, RSA/ECDSA signatures) solve key agreement and identity but are relatively slow.
- Symmetric ciphers such as AES-GCM or ChaCha20-Poly1305 are very fast and encrypt the bulk data, also providing integrity.
- Using ephemeral key exchange gives forward secrecy: stealing the server's private key later does not decrypt previously recorded sessions.
How the browser trusts the server
- The certificate binds a domain name to a public key and is signed by a Certificate Authority (CA).
- The browser checks the chain up to a root CA in its trust store, that the certificate covers the requested hostname, that it is within its validity period, and that it has not been revoked.
Common mistake: saying the server's public key encrypts all traffic — it is used only in the handshake. Follow-up: "What can an observer still see with HTTPS?" The IP addresses, ports, timing and sizes, and usually the hostname via SNI or DNS — but not the URL path, headers or body.
Original UniCircle question. Last reviewed 28 Oct 2026.
