How Does Encryption Work? Keys, Locks, and Why HTTPS Is Safe Enough

Encryption scrambles a message so that only someone holding the right key can unscramble it, and modern life depends on it working billions of times a day without anyone noticing. The interesting part is not the scrambling but the key exchange: two strangers who have never met agree on a secret while an eavesdropper listens. That is what the padlock in a browser means. For the network below it, see how Wi-Fi works.

Symmetric encryption: one key, two ends

The oldest model: both sides use the same key. It is fast and is what actually protects your data once a connection is established. The problem is delivery — how do two parties share a key without meeting?

Why it is still used: symmetric ciphers such as AES process gigabytes per second on ordinary hardware, while public-key operations are thousands of times slower. So public-key methods set up a session, and symmetric encryption carries the traffic.

Public-key encryption: a padlock anyone can use

Each party publishes a public key and keeps a private one. Anything locked with the public key can only be opened with the private key, so a stranger can send you a secret without ever possessing your secret.

The catch: it only works if you are sure the public key really belongs to the other party. That is what certificates and certificate authorities are for — they are the trust layer, not the maths.

What happens when you open an HTTPS page

Your browser checks the site’s certificate against a trusted list, verifies the signature, and negotiates a shared session key using a key-exchange method that never transmits the key. From then on, traffic is encrypted symmetrically.

What the padlock proves: you are talking to whoever holds the certificate for that domain, and nobody in between can read or alter the page. It does not prove the site is honest, well-run, or that the goods are real.

Hashing and passwords

Services should not store your password, only a salted hash of it. When you log in, they hash what you typed and compare. A salt makes identical passwords produce different hashes, so a stolen database cannot be attacked in bulk.

Why password reuse is the real risk: a breach at one site exposes a password that unlocks others. Encryption protects data in transit; it cannot protect you from a site that mishandles it at rest.

End-to-end encryption

In end-to-end systems the service relays ciphertext it cannot read, because keys exist only on the devices. This is why a messaging provider can honestly say it cannot hand over message contents.

The trade-off: the same property blocks abuse detection and account recovery by the provider. That tension is a policy argument, not a technical one.

What encryption cannot do

  • It cannot stop someone reading your screen.
  • It cannot protect a device that is already compromised by malware.
  • It does not hide metadata such as timing, size, or the domain you contacted.
  • It cannot fix a weak password or a phishing page.

What to ask afterwards

  • Why do we not encrypt everything with public-key methods? (Too slow for bulk data.)
  • What does a certificate authority actually vouch for? (That the key belongs to the domain owner.)
  • Why is a long passphrase better than a short complex password? (Search space grows exponentially with length.)
  • What does “zero knowledge” mean in a password manager? (The vendor cannot decrypt your vault.)

Related: cloud computing, databases, and Tech & AI.

Leave a Comment