Classical ciphers
The pen and paper half of the library, plus one machine. They work on letters A to Z and leave everything else where it was, so a sentence keeps its spaces and its commas and still reads like a sentence after encoding. Great for riddles, lessons and CTFs. Useless for anything you actually want to keep secret, and that's fine, it's not what they're here for.
| Options | Keyspace | ||
|---|---|---|---|
| Caesar Ciphercaesar | Shift | shift? | 25 |
| ROT-13rot13 | Shift | none | 1 |
| ROT-47rot47 | Shift | none | 1 |
| Atbashatbash | Reflection | none | 0 |
| Vigenèrevigenere | Polyalphabetic | key | 26^keyLength |
| Beaufortbeaufort | Polyalphabetic | key | 26^keyLength |
| Autokeyautokey | Polyalphabetic | key | 26^keyLength |
| Trithemiustrithemius | Polyalphabetic | none | fixed |
| Albertialberti | Polyalphabetic | key, period | not stated |
| Rail Fencerail-fence | Transposition | rails? | ~n |
| Affine Cipheraffine | Multiplicative | a?, b? | 12 × 26 = 312 |
| Playfairplayfair | Digraph | key | 25! ≈ 1.5×10²⁵ |
| Polybius Squarepolybius | Fractionation | key? | 1 |
| Morse Codemorse | Fractionation | none | 1 |
| Bacon's Cipherbacon | Fractionation | letters? | 2 |
| Tap Codetap-code | Fractionation | none | 1 |
| Columnar Transpositioncolumnar | Transposition | key | n! |
| ADFGVXadfgvx | Fractionation | key?, transposition? | 36! grids × n! column orders |
| Bifid Cipherbifid | Fractionation | key?, period? | 25! × period variants |
| Enigma M3enigma | Rotor | positions?, rings?, plugboard? | 26^6 × plugboard configurations |
Conventions they share
- Latin alphabets are A to Z. Digits, punctuation, emoji and non-Latin letters pass through untouched unless
stripNonAlphais set, and they never advance a key. preserveCaseis on by default. Lowercase in, lowercase out.- Playfair, Polybius and Bifid fold J into I. Tap code shares C and K. Bacon uses 26 letters unless
letters: 24asks for his own table. Enigma is the Wehrmacht M3 with rotors I, II, III and reflector B. - Shift 0, one rail, a multiplier sharing a factor with 26. An option that would make the cipher an identity or break the bijection is an error before the first letter. No silent pass.
Families
Shift adds a constant to every letter. Reflection mirrors the alphabet. Multiplicative multiplies and adds modulo 26. Polyalphabetic changes the shift as it goes, by keyword, by position or by turning a disk. Digraph works on pairs. Fractionation breaks a letter into coordinates or symbols and, in Bifid and ADFGVX, shuffles the pieces. Transposition moves letters without changing a single one. Rotor has one member, and that one has enough settings for the rest of the list combined.
Where to start
Stuck on a puzzle? Count the letters first. A histogram that still looks like English means one alphabet, maybe shifted, and a Caesar brute force takes a second. A flat one means a key that changes as it goes, so the Vigenère family is the next stop.