π How Do We Keep Secrets Online?
Encryption Explorer
Every time you log in, send a message, or buy something online, encryption scrambles your data so only the right person can read it. See how it works.
CS GCSE Β§1.5
CS A-Level Unit 3
DigiTech GCSE Β§1.1.5
DigiTech A-Level Unit 3
π€ What is encryption?
Encryption turns readable data (plaintext) into scrambled nonsense (ciphertext) using a secret key. Only someone with the right key can turn it back into the original message. Without the key, it looks like random letters.
π¬ Analogy: Imagine putting a letter in a locked box. Anyone can carry the box, but only the person with the key can open it and read the letter. Encryption is the lock, and the key is... well, the key.
ποΈ Caesar Cipher
π VigenΓ¨re Cipher
π Symmetric vs Asymmetric
ποΈ Caesar Cipher
The simplest cipher β shift every letter by a fixed number. Named after Julius Caesar, who used it to send secret military messages 2,000 years ago.
β οΈ Why Caesar is weak: There are only 25 possible shifts. An attacker can try all 25 in seconds β this is called a brute force attack. Also, letter frequency analysis works: in English, 'E' is the most common letter, so the most common letter in the ciphertext is probably 'E' shifted.
π VigenΓ¨re Cipher
Instead of one shift for all letters, each letter gets a different shift based on a keyword. This makes frequency analysis much harder. It was considered "unbreakable" for 300 years.
π Why it's stronger: With Caesar, the letter 'E' always becomes the same letter. With VigenΓ¨re, 'E' can become different letters depending on its position β because the shift changes with each letter of the keyword. A longer keyword = harder to crack.
π Symmetric vs Asymmetric Encryption
Modern encryption uses two approaches. Click each to see how they work:
π
Symmetric
Same key to lock AND unlock
Alice π§ β π encrypt with KEY β π ciphertext β π decrypt with KEY β Bob π§
- Fast β good for large files
- Problem: How do you share the key securely?
- Examples: AES (used in WiFi, banking)
- Like a padlock with copies of the same key
πποΈ
Asymmetric
Different keys β public to lock, private to unlock
Alice π§ β π encrypt with Bob's PUBLIC key β π β π decrypt with Bob's PRIVATE key β Bob π§
- Solves key sharing β public key is... public!
- Slower β more maths involved
- Examples: RSA, HTTPS (the π in your browser)
- Like a postbox β anyone can put letters in (public), only you have the key to open it (private)
| π Symmetric | πποΈ Asymmetric |
| Keys | 1 shared key | 2 keys (public + private) |
| Speed | Fast β‘ | Slower π’ |
| Key sharing | Hard β must share secretly | Easy β public key is public |
| Best for | Encrypting data (files, disks) | Exchanging keys, digital signatures |
| Real-world use | AES-256, WiFi (WPA2) | RSA, HTTPS, email signing |
π Exam tip: In practice, HTTPS uses both! Asymmetric encryption is used first to safely share a symmetric key, then symmetric encryption handles the actual data (because it's faster). This is called a hybrid approach.