Skip to content
HowlumeAll topics

How does HTTPS keep websites secure?

You (browser)Website👀 eavesdropper sees the middlepublic colouryour secretsite’s secretpublic + yourssent in the open →public + site’s← sent in the openyour resultsite’s resulteavesdropper’s guess✓ You and the site now share a secret colour nobody else has

You add your secret to the site's public mix; the site adds its secret to yours. Both end up with public + yours + site's. The eavesdropper only saw the two half-mixes: combining them gives a colour with too much public paint in it, and she can't un-mix them to get either secret.

The paint-mixing analogy for Diffie–Hellman key exchange, the idea behind the padlock in your browser. Mixing paint is easy; un-mixing it is practically impossible. Real HTTPS uses the same trick with maths that is easy one way and infeasible to reverse.

Overview

Short answer

HTTPS encrypts everything between your browser and a website. The two sides agree on a secret key in public using key exchange, which an eavesdropper can’t reverse, and the site proves its identity with a certificate signed by an authority your browser trusts.

The padlock next to a website address means your connection uses HTTPS: everything between your browser and the site is encrypted, so people on the same WiFi, your internet provider or anyone along the way see only scrambled data. The hard part is agreeing on a secret key with a computer you have never met, over a connection anyone can watch.

Play with the figure, then press Next (or the → key) to go step by step.