The Lab
Cryptography

Cipher Playground

Classical ciphers, a 3-rotor Enigma, educational RSA, and a couple of hashes, all running live in the browser. Nothing leaves your machine.

Caesar shift

Vigenère

XOR

The key repeats across the text and each byte is XOR'd. The same key turns the hex back into text.

RC4

A stream cipher: the key seeds a keystream that is XOR'd with the data. Educational only, RC4 is broken and unsafe for real use.

Atbash

Mirrors the alphabet, A to Z, B to Y, and so on. It is its own inverse, so the same operation decodes it.

ROT13

A Caesar shift of 13. Because 13 is half of 26, applying it twice returns the original.

Affine

E(x) = (a·x + b) mod 26. The multiplier a has to be coprime with 26 or the mapping is not reversible, so only 12 values of a are allowed.

Rail Fence

A transposition: write the text in a zigzag down and up the rails, then read it off row by row. It reorders the letters instead of substituting them.

Enigma

A 3-rotor Enigma I (historical rotor wirings I to V, reflectors B and C). Encryption and decryption are the same operation, so match the settings and type. Rotors I II III, rings AAA, position AAA, reflector B, no plugboard: typing AAAAA gives BDZGO.

RSA (educational)

Pick two primes and the tool derives n = p·q, φ(n), and the private exponent d. Each character is encrypted as c = me mod n and decrypted with d. Small primes only, so this shows the math, it is not secure. n has to exceed 255 to fit a byte.

CRC-32

A checksum, not a cipher: the standard CRC-32 (polynomial $EDB88320) used in zip, PNG, and Ethernet. The string 123456789 checks to $CBF43926.

SHA-256

A cryptographic hash, computed by the browser's WebCrypto. One-way, so there is nothing to decode. SHA-256 of abc starts ba7816bf and ends f20015ad.