How HTTPS Works
Why the padlock appears, and what it actually guarantees.
When a website address begins with https://, everything sent between your
browser and that site is encrypted and protected against tampering. Here is how that
arrangement is set up.
HTTP, and then the secure version
HTTP is the language browsers and servers use to exchange pages. Plain HTTP sends that conversation in the clear, where anyone positioned between the two can read or alter it. HTTPS is simply HTTP carried inside a security layer called TLS (Transport Layer Security). The page is the same; the delivery is sealed.
Two jobs: privacy and identity
- Privacy — nobody in the middle can read what is sent, or quietly change it.
- Identity — you are genuinely talking to the site you think you are, and not to an impostor.
Certificates prove identity
A website proves who it is with a certificate — a small file that ties a domain name to a cryptographic key. Certificates are issued by certificate authorities, organisations that check the request and then sign the result. Your browser ships with a list of authorities it trusts; if a site presents a certificate signed by one of them, for the right name, the browser is satisfied.
The handshake, simplified
- Your browser and the server agree on a version of TLS and a set of algorithms.
- The server presents its certificate; the browser checks the name and the signature.
- Using the certificate's public key, the two sides establish a shared secret.
- From then on, all traffic is encrypted with fast symmetric keys derived from that secret.
What the padlock means — and doesn't
The padlock says the connection is encrypted and the certificate is valid for that name. It does not say the site is honest or safe. A well-built phishing site can hold a perfectly valid certificate. HTTPS protects the channel, not the intentions of whoever is at the other end.
Forward secrecy
Modern setups use temporary, "ephemeral" keys for each session. The benefit is that even if a server's long-term key were later stolen, past conversations could not be decrypted retroactively.