Encryption, from the ground up · Start here · 1 of 6
Anyone on the line
Your app sends a password to a server. Between the two sit a café's Wi-Fi, a phone operator and a dozen machines you don't control. Here's what any of them can do, and the first defence that stops it.
The problem
Your app sends the user's password to your server. It doesn't fly there directly: it goes through the café's Wi-Fi, the internet provider, and many machines in between, each one passing it along. Every one of them sees every byte. What could one of them do with it?
See it
Your app sends a password. It doesn't fly straight to your server: it passes through the café's Wi-Fi and many machines after it.
Step 1 of 4Any of them can read it as it passes: every byte, in plain sight.
Step 2 of 4In fact, any of them could do three things: read it, change it, or pretend to be your server. Predict: what stops the reading?
Step 3 of 4Encryption: with a secret key, your app turns the data into gibberish, ciphertext. The listener sees bytes that mean nothing.
Step 4 of 4
The building block
Call any such machine the listener (or the attacker: same machine). It can do three things, and the later puzzles build the blocks that stop them:
- read what passes by: the password, the token, the card number;
- change it on the way: a different amount, a different account;
- pretend to be the other side: answer as if it were your server.
The first block stops the reading. Encryption turns data into gibberish that only someone holding the right key, a secret number, can turn back (decrypt). The gibberish is ciphertext. A machine in the middle still sees every byte, but they mean nothing to it.
Encryption alone doesn't stop the other two. Someone can still change ciphertext (the result is garbage, or quietly different data, and nobody notices unless something checks), and encryption with someone who is pretending to be your server protects nothing. Puzzles 3 and 4 add those checks. First, though: where does the key come from?
The analogy
Sending a postcard through a chain of strangers. Anyone can read it. Write it in a code only your friend can read, and the strangers see nonsense. But a stranger could still scribble on it, or hand it to someone pretending to be your friend.
Check yourself
Sources
- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3 ("TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery"; its goals are authentication, confidentiality and integrity, "even in the face of an attacker who has complete control of the network")
What you now know
Data crosses many machines on its way. Any of them can read it, change it, or pretend to be the other side. Encryption turns the data into ciphertext that only someone with the key can turn back, which stops the reading. The next puzzles stop the rest.
Answer every question above correctly to unlock the next puzzle.
Something wrong or unclear on this page? Tell me: a puzzle that didn't click is a bug in the puzzle.