Cryptography Lab: Ciphers, RSA, Hashes & AES

Free cryptography tools in your browser: Caesar, Vigenère, affine, Atbash and rail fence ciphers, crack secret messages with letter frequencies, build an RSA key from two primes step by step, Diffie-Hellman key exchange, MD5 and SHA-256 hashes, and real AES encryption with a password.

Quantum ›

How it works

Cryptography, explained

Cryptography is the maths of keeping messages secret and proving they were not changed. This page lets you try every big idea in it, from the Caesar shift Julius Caesar used to the RSA and AES encryption that protects the web today. Everything runs in your browser: nothing you type is uploaded.

What each tab does

  • Ciphers: encrypt and decrypt with the Caesar shift, ROT13, Atbash, affine, Vigenère, Beaufort, keyword substitution and rail fence ciphers, with a picture of how each one moves the letters.
  • Crack a cipher: break a secret message without the key using letter frequencies, the index of coincidence and the Kasiski test, the way codebreakers did for centuries.
  • RSA: build a public and private key from two primes step by step (n = p × q, φ(n), e and d with the extended Euclidean algorithm), send a message, then try to break the key by factoring n.
  • Key exchange: Diffie–Hellman, shown with mixing paint and with real numbers, and why the eavesdropper can't solve the discrete logarithm.
  • Hashes: MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32 of text or a file, plus the avalanche effect bit by bit.
  • Encrypt with a password: real AES-256-GCM encryption of text or files with your browser's Web Crypto.
  • Base64, hex, Morse… and Modular maths: the encodings and number tricks cryptography is built on.

Questions people ask

What is the difference between a code, a cipher and encoding?
A cipher changes letters or bits with a rule and a key (Caesar, AES). A code swaps whole words for code words from a book. Encoding (Base64, Morse) has no key at all: anyone can reverse it.
Why is the Caesar cipher so easy to break?
There are only 25 possible shifts, so a computer tries them all at once, and letter frequencies point to the right one: E, T and A stay the most common letters, just moved.
Why does RSA use prime numbers?
Multiplying two big primes is quick, but splitting the product back into them is extremely slow. Your public key holds the product n; only you know the two primes, and you need them to work out the private key d. See the prime number checker to factor numbers yourself.
Is the RSA tab safe for real secrets?
No. It is “textbook RSA” for learning: no padding, and keys you can see. For real secrets use the password tab (AES-256-GCM) or a proper app.
Can a hash be reversed?
No. A hash throws information away, so many inputs share each output; the only way back is guessing inputs. That is why short or common passwords get cracked: attackers hash billions of guesses.
How strong is the password encryption?
AES-256 itself has never been broken. The weak point is the password: the page estimates how long a guessing attack would take, so use a long passphrase.

What about quantum computers?

A big enough quantum computer would break RSA, Diffie–Hellman and elliptic curves with Shor's algorithm, and halve the strength of AES with Grover's. Try both, plus quantum key distribution and the new post-quantum standards, in Quantum Cryptography, and test any site with the Quantum-Safe Website Checker.

Related: Quantum Cryptography · Quantum-Safe Checker · Prime Numbers · Enigma Machine · Matrix Calculator · File Safety Check · More tools

Comments
Advertisement