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 |
| Substitutionsubstitution | Mixed alphabet | key | 26! |
| Vigenèrevigenere | Polyalphabetic | key | 26^keyLength |
| Gronsfeldgronsfeld | Polyalphabetic | key | 10^keyLength |
| Beaufortbeaufort | Polyalphabetic | key | 26^keyLength |
| Portaporta | Polyalphabetic | key, rotation? | 13^keyLength |
| Autokeyautokey | Polyalphabetic | key | 26^keyLength |
| Running keyrunning-key | Polyalphabetic | key | 26^textLength |
| Trithemiustrithemius | Polyalphabetic | none | fixed |
| Albertialberti | Polyalphabetic | key, period | not stated |
| Quagmire Iquagmire-1 | Polyalphabetic | key, indicator, indicatorUnder? | 26! × 26^indicatorLength |
| Quagmire IIquagmire-2 | Polyalphabetic | key, indicator, indicatorUnder? | 26! × 26^indicatorLength |
| Quagmire IIIquagmire-3 | Polyalphabetic | key, indicator, indicatorUnder? | 26! × 26^indicatorLength |
| Quagmire IVquagmire-4 | Polyalphabetic | key, secondKey, indicator, indicatorUnder? | (26!)² × 26^indicatorLength |
| Chaocipherchaocipher | Polyalphabetic | key, secondKey | 26! × 25! |
| Rail Fencerail-fence | Transposition | rails? | ~n |
| Affine Cipheraffine | Multiplicative | a?, b? | 12 × 26 = 312 |
| Playfairplayfair | Digraph | key | 25! ≈ 1.5×10²⁵ |
| Four-squarefour-square | Digraph | key, secondKey, omit? | (25!)² ≈ 2.4×10⁵⁰ |
| Two-squaretwo-square | Digraph | key, secondKey, orientation?, omit? | (25!)² ≈ 2.4×10⁵⁰ |
| Hillhill | Polygraphic | key, alphabet? | 157,248 |
| Polybius Squarepolybius | Fractionation | key?, alphabet? | 1 |
| Nihilistnihilist | Fractionation | key, square? | 25! squares times 25^n keys of n letters |
| Morse Codemorse | Fractionation | none | 1 |
| Fractionated Morsefractionated-morse | Fractionation | key | 26! |
| Bacon's Cipherbacon | Fractionation | letters?, lowercase? | 2 |
| Tap Codetap-code | Fractionation | none | 1 |
| A1Z26a1z26 | Fractionation | separator?, zero? | 1, or 17 in the single digit form |
| Book Cipherbook | Homophonic | book, address?, pick?, start? | every text both sides have |
| Columnar Transpositioncolumnar | Transposition | key | n! |
| Route Transpositionroute | Transposition | width, corner?, path? | ~20n |
| ADFGVXadfgvx | Fractionation | key?, transposition? | 36! grids × n! column orders |
| Bifid Cipherbifid | Fractionation | key?, alphabet?, period? | 25! × period variants, 36! on a 6×6 |
| Trifid Ciphertrifid | Fractionation | key?, period?, symbol? | 26! × period variants |
| Straddling Checkerboardstraddling-checkerboard | Fractionation | key?, blanks? | 28! boards × 90 ordered pairs of blanks |
| Tridigitaltridigital | Mixed alphabet | key, secondKey | 10! digit orders × 26! alphabets |
| 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 or a Hill matrix with no inverse. 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. Mixed alphabet shuffles the whole thing. By keyword or by hand. 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. Polygraphic runs a whole block through a matrix, so one letter changes all of it. Fractionation breaks a letter into coordinates or symbols and, in Bifid and ADFGVX, shuffles the pieces. Nihilist adds a key to them instead. 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.