How HTTPS & TLS Work
How two strangers agree on a secret nobody else can read.
HTTPS is HTTP running inside a TLS tunnel. TLS lets a browser and a server that have never met agree on a shared encryption key over an open, hostile network — and prove the server is who it claims to be.
Legend — how to read this diagram
The handshake
- ClientHello. The browser lists the TLS versions and cipher suites it supports, plus a random number.
- ServerHello + certificate. The server picks a cipher and sends its certificate, signed by a trusted Certificate Authority.
- Verify. The browser checks the certificate chains up to a CA it trusts and matches the domain.
- Key exchange. Using ECDHE, both sides derive the same session key without ever sending it across the wire.
- Finished. Both send a MAC over the whole handshake. From here, everything is symmetrically encrypted.
Why it's secure
Asymmetric to bootstrap, symmetric to run. Public-key crypto is slow, so it's used only to agree on a fast symmetric key.
Forward secrecy. Ephemeral keys (ECDHE) mean stealing the server's private key later can't decrypt old traffic.
Trust anchors. Your device ships with ~150 trusted CAs; the whole system rests on their signatures.
Use expensive public-key math once to agree on a cheap shared secret, prove identity with a signed certificate, then encrypt everything.
No comments:
Post a Comment