Symmetric encryption
One secret key, shared by sender and receiver, both locks (encrypts) and unlocks (decrypts) the message. Without that key, the message is unreadable.
One key to lock and unlock
Genuine AES-GCM Simulated networkEncryption lab
Genuine AES-256-GCM Simulated network and attackerWhat happened
Block ciphers and stream ciphers
Simplified viewEncryption algorithms process data in one of two ways. You do not need to know what happens inside, only how the data is cut up.
Block cipher (for example AES)
The message is cut into fixed-size blocks (16 bytes for AES). Each block goes through the cipher with the key.
Stream cipher (for example ChaCha20)
The key generates a long stream of pseudo-random bytes. Each byte of the message is combined with the next byte of the stream, one by one.
Both kinds are secure when used correctly, and both are used in HTTPS. AES-GCM, used in this tool, is the block cipher AES used in a mode (GCM) that also adds an authentication tag.
Key ideas
Plaintext and ciphertext
The readable message is the plaintext. After encryption it becomes ciphertext: unreadable without the key.
One shared key
The same secret key encrypts and decrypts. That is why it is called symmetric. Anyone who has the key can read everything.
Fast
Symmetric encryption is very fast. It protects almost all data in practice: disks, Wi-Fi, VPNs and HTTPS traffic.
Authenticated encryption
Modern modes such as AES-GCM add an authentication tag, which plays the role of a MAC (Tool 2). Any change to the ciphertext, or a wrong key, is detected, and decryption is refused.
Nonce (IV)
Each encryption uses a fresh random value, the nonce. Encrypting the same message twice therefore gives different ciphertexts, so Eve cannot see that a message is repeated.
Common misconceptions
Where you meet symmetric encryption
Disk encryption
BitLocker (Windows), FileVault (macOS) and LUKS (Linux) encrypt the whole disk with AES. A stolen laptop reveals nothing.
Wi-Fi
WPA2 and WPA3 encrypt every frame with AES. Everyone who knows the network password can derive keys for it.
HTTPS and VPNs
After the handshake, all the data of a website or VPN tunnel is encrypted with AES-GCM or ChaCha20-Poly1305.
Encrypted archives
7-Zip and similar tools can encrypt files with AES-256, using a key derived from a password.
Challenges
1. Same message, same ciphertext?
Encrypt the same message twice with the same key. Compare the two ciphertexts. Why are they different, and why is that a good thing?
Show answer
2. The tampered message
Encrypt a message, flip one bit of the ciphertext, then decrypt with the correct key. What does Bob get? Which tool explains the mechanism behind this?
Show answer
3. How do you send the key?
Alice is in Luxembourg, Bob in Montreal. They have never met. How can they agree on a key without Eve learning it? Write down your idea, then continue with Tools 4 and 6.