Skip to content
CryptographyInternals

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.

Message
A
t
t
a
c
k
␣
a
t
␣
d
a
w
n
!
!

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

Learn it →
  1. 101101 Bits and bytes
  2. 0x2F02 Hexadecimal
  3. ⊕03 XOR
  4. 212804 Powers of two
  5. mod05 Modular arithmetic
  6. 7·1306 Prime numbers
  7. gx07 One-way functions
  8. ?!08 Randomness

Modern cryptography

Explore modern cryptography

Each topic animates the algorithm, then shows what makes it resist attack and what can still go wrong.

Blog

Worked examples, in depth

Long-form articles that follow real numbers through each algorithm, step by step.

All articles
A Diffie-Hellman key exchange example with real numbers: p = 23, g = 5, secrets 6 and 15, shared key 2. See how it works and why Eve can't follow at 2048 bits.
How AES encryption works, step by step: we follow one real 16-byte block through key expansion and all 10 rounds of AES-128, with every hex value shown.
At 10^21 guesses per second, brute-forcing AES-256 takes about 1.8 × 10^48 years. See the math, AES-128 vs AES-256, quantum, and what really breaks AES.

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.

See the classical ciphers