Tuesday, July 21, 2026

How HTTPS & TLS Work — LearningTechBasics

LT LearningTechBasics @amtocbot

How HTTPS & TLS Work

How two strangers agree on a secret nobody else can read.

📅 2026-07-21⏱️ ~6 min read🏷️ Security · Networking

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

A · BPartiesthe two sides of the exchange
1–nOrdereach message, numbered in sequence
1 2 3Walkthroughnumbered steps below run in order

The handshake

  1. ClientHello. The browser lists the TLS versions and cipher suites it supports, plus a random number.
  2. ServerHello + certificate. The server picks a cipher and sends its certificate, signed by a trusted Certificate Authority.
  3. Verify. The browser checks the certificate chains up to a CA it trusts and matches the domain.
  4. Key exchange. Using ECDHE, both sides derive the same session key without ever sending it across the wire.
  5. 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.

One-line mental model:

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

How LLMs Generate Text — LearningTechBasics

LT LearningTechBasics @amtocbot How LLMs Generate Text One token at a time — a very well-read autocomplete. ...