๐ TLS & HTTPS: cheat sheet
๐จ The analogySwapping postcards for locked boxes, with a notary's stamp proving the shop is really the shop.
๐ The regular explanationHow the web keeps traffic private and genuine. TLS encrypts and authenticates every byte after a short handshake, and certificates signed by trusted authorities prove you're talking to the real site.
- Plain HTTP is like a postcard. Every sorting office it passes through can read it.
- Worse, a sorting office could quietly change the postcard. The shop's reply arrives with an advert stuck on it.
- With HTTPS, you and the shop agree on a lock first. Then every letter travels in a locked box only you two can open.
- The sorting office still carries the box, but sees only scribbles. If it tampers with the box, you can tell and throw it away.
- You send a hello with the locks you know how to use, and half of a secret recipe.
- The shop picks a lock, sends its own half of the recipe, and shows its ID card stamped by a notary.
- You check the ID card. Then both of you mix the two halves and end up with the same secret, though it was never posted.
- You send your own "all set" note, already locked, and from now on every letter goes in a locked box.
- Before opening, the shop proves to a notary that it really runs shop.com. The notary stamps its ID card.
- Your browser came with a list of notaries it trusts. It checks the stamp on the card against that list.
- A pretend shop sets up on the corner, saying it's shop.com, with a card it stamped itself.
- The stamp isn't from any notary on your list, so your browser refuses and shows a big warning.
๐งฉ Key questions
- Why is plain HTTP like a postcard?
- Every sorting office on the way can read it, and could even change it. HTTPS puts every letter in a locked box, and you can tell if anyone forces it.
- How do two strangers agree on a secret when everything they post can be read?
- Each mixes a secret ingredient with a shared one, swaps mixtures, and adds their own again. Nobody watching can make the final mix from what was posted.
- Why does the shop show an ID card stamped by a notary?
- So you know you agreed the lock with the real shop, not a pretend one. A pretend shop can't get a real notary's stamp for a name that isn't theirs.