Passing notes in class is risky. If the teacher gets hold of one, everyone can read it. So you and your best friend make up a secret code: every letter is swapped for the letter three places later in the alphabet. A becomes D, B becomes E, and so on. 'HELLO' becomes 'KHOOR'.
Anyone who finds the note sees nonsense. But your friend knows the rule, so they can swap each letter back. You have just used encryption.
The words have grown-up names:
- Plaintext is the message anyone can read.
- Ciphertext is the scrambled version.
- Cipher is the method of scrambling.
- Key is the secret part, such as 'three places'. Without it, the note is just nonsense.
The letter-shifting trick is old. It is called the Caesar cipher, because the Roman writer Suetonius says Julius Caesar used it. It is also very easy to crack. Someone could just try every shift until a word appears.
Modern encryption uses maths instead of letter swaps, and the keys are enormous. The number of possible keys is so large that trying them all would take longer than anyone could wait, even with powerful computers.
So how can two people who have never met share a secret? One clever answer is public-key encryption. It is like a padlock. You give out open padlocks to everyone. Anyone can snap one shut around a message, but only you hold the key that opens it.
You use this every day. The padlock icon in your browser means the connection is encrypted, so that people on the same coffee-shop Wi-Fi cannot read what you send. Many messaging apps use end-to-end encryption, which means only the two people chatting can read the messages, and not even the company running the app.
Encryption locks the message, but it cannot protect a key that is shared by mistake.
Picture it
Picture a box with a padlock. You can put anything inside, and snap the padlock shut. Anybody who finds the box can carry it, shake it and stare at it, but cannot see what is inside. Only the person with the key can open it. Encryption is that box, made of maths.
Words you might hear
- Cipher
- a method for scrambling and unscrambling messages
- Key
- the secret that lets you lock or unlock a message
- End-to-end
- only the sender and the receiver can read the message, nobody in between
One step further
Hashing is a related idea that is not encryption. A hash function turns any data into a short fingerprint that cannot be turned back, and it is used to check passwords and downloads without storing the secret itself. Encryption can be undone with the right key, and hashing cannot. In practice, secure websites use both: public-key methods to agree on a secret, and faster symmetric methods, where one key locks and unlocks, to protect the actual traffic.
Next questions
- How does the internet work?
Millions of computers joined by cables and radio waves, passing tiny pieces of messages to each other until they arrive.
- What is a blockchain?
A notebook that everyone keeps a copy of, where new pages can be added but old pages cannot be changed without everyone noticing.
- What is an algorithm?
A list of clear steps, done in order, that gets a job done every time.
Sources
Questions
Can encrypted messages be broken?
Strong, modern encryption has not been broken by guessing. Attacks usually go around it, for example by stealing a password or tricking a person. Old or weak methods, like the Caesar cipher, are easy to break.
What does the padlock in the browser mean?
It means the connection between your browser and the site is encrypted, so others on the way cannot read it. It does not by itself prove that the site is honest or safe.
What is the difference between encryption and a password?
A password proves who you are. Encryption scrambles data. They often work together: a password can unlock a key, and the key can unlock your encrypted data.




