LAB / EXPERIMENT

Encryption Playground

Type a message, choose a cipher, and watch encryption happen in real time. Adjust the key and see how the ciphertext changes. Try breaking the substitution cipher using frequency analysis.

Shifts each letter by a fixed number of positions in the alphabet. Used by Julius Caesar for military correspondence. Trivially breakable — only 25 possible keys.

Toy cipher — breakable by hand in minutes

Plaintext

Ciphertext

wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj

Frequency analysis

r
11%
h
9%
w
6%
k
6%
x
6%
u
6%
t
3%
l
3%

What This Shows

These are three historical approaches to the same problem: making a message unreadable to anyone without the key.

Caesar cipher is the simplest — shift every letter by a fixed amount. It has only 25 possible keys, so an attacker can try them all in seconds. This is a brute force attack.

Substitution cipher has a vastly larger keyspace (26! possible keys), but it preserves the frequency distribution of letters. In any English text, 'e' is the most common letter. If 'q' is the most common letter in the ciphertext, the attacker knows q maps to e. This is frequency analysis.

XOR cipher is the mathematical foundation of modern encryption. It's perfectly secure when the key is as long as the message (a one-time pad), but weak when the key repeats. Real ciphers like AES solve this by expanding a short key into a long, non-repeating keystream.

Modern encryption (AES-256, used in HTTPS) is not shown here because it's computationally intensive and its output looks like random noise — which is exactly the point. A good cipher produces output that is indistinguishable from randomness.

SEARCH