AESSHA-256Diffie–HellmanRSA
See why modern cryptography doesn’t break.
Run the real algorithms in your browser, step by step. Flip one bit and watch it scramble everything, try to crack a key, and see the numbers that keep your data safe.
01 / 17 · Inside AES-128
A message
AES (Advanced Encryption Standard) is the cipher that protects most of what you send online. Follow one message through it: 16 characters, exactly the amount AES scrambles at once. Type your own.
Encrypting turns a readable message into something only the key holder can read back.
By the numbers
- possible AES-128 keys, about 3.4 × 10³⁸
- 2¹²⁸possible AES-128 keys, about 3.4 × 10³⁸
- to find one by brute force, even at the whole Bitcoin network’s speed
- 5.4 billion yearsto find one by brute force, even at the whole Bitcoin network’s speed
- bits of AES output change after flipping one input bit, in just two rounds
- 64 / 128bits of AES output change after flipping one input bit, in just two rounds
- in the 2048-bit prime behind a classic Diffie–Hellman exchange
- 617 digitsin the 2048-bit prime behind a classic Diffie–Hellman exchange
Math basics
New to cryptography? Start with the math basics
Modern cryptography
Explore modern cryptography
Each topic animates the algorithm, then shows what makes it resist attack and what can still go wrong.
Symmetric encryption
One shared key to encrypt and decrypt.
Brute force and key size
Why trying every key stops being an option once keys reach 128 bits.
ExploreAES
The block cipher protecting most of the world's encrypted data, one round at a time.
ExploreModes of operation
AES encrypts 16 bytes. Everything longer depends on how the blocks are chained.
ExploreHashing
Fingerprints that can't be reversed.
Public-key cryptography
Secrets between strangers, and proof of who you are.
Diffie–Hellman key exchange
Two strangers agree on a secret while everyone is listening.
ExploreElliptic curves
Add points on a curve: easy forward, hopeless backward, with keys 12 times shorter than RSA.
ExploreRSA
Easy to multiply two primes, astronomically hard to split the result.
ExploreDigital signatures
Proof of who wrote a message, and that not one bit of it has changed.
ExploreIn practice
How it all fits together, today and tomorrow.
TLS 1.3
What happens when you open an HTTPS page
In the first milliseconds of a TLS connection, all four ideas work together. Each step links to its visualization.
Step 1
Agree on a secret
Your browser and the server run a Diffie–Hellman exchange in public. Anyone can watch; nobody else ends up with the key.
- 61 × 53 = 32333233 = ? × ?
Step 2
Prove who you are
The server signs the exchange with the private key behind its certificate (RSA or ECDSA), so an attacker can’t sit in the middle.
Step 3
Detect tampering
Every handshake message is hashed. If a single bit was altered on the way, the fingerprints don’t match and the connection stops.
Step 4
Encrypt everything
From then on, every byte of the page is encrypted with AES using keys derived from the shared secret.
Blog
Worked examples, in depth
Long-form articles that follow real numbers through each algorithm, step by step.
Classical ciphers
And why the old ciphers broke
Caesar, Vigenère and friends, step by step. Each one falls to brute force or frequency analysis, which is exactly what modern designs prevent.