Ciphers
Every cipher answers encode and decode with the same CipherResult. What changes is the alphabet it works on, the options it needs, and the small decisions that make a puzzle answer reproducible - which letters share a cell, what happens to a doubled pair, whether a space survives. Those decisions are the part nobody documents, so each page here does.
| Cipher | Family | Options | Self-inverse | Keyspace |
|---|---|---|---|---|
| Caesar | shift | shift | ✗ | 25 |
| ROT-13 | shift | ✓ | 1 | |
| ROT-47 | shift | ✓ | 1 | |
| Atbash | reflection | ✓ | 1 | |
| Affine | multiplicative | a, b | ✗ | 312 |
| Vigenère | polyalphabetic | key | ✗ | 26^key length |
| Trithemius | polyalphabetic | ✗ | fixed | |
| Alberti | polyalphabetic | key, period | ✗ | keyed disk × period |
| Playfair | digraph | key | ✗ | 25! |
| Polybius | fractionation | key optional | ✗ | 1 or 25! |
| Morse | fractionation | ✗ | 1 | |
| Bacon | fractionation | ✗ | 1 | |
| Tap code | fractionation | ✗ | 1 | |
| ADFGVX | fractionation | key optional | ✗ | 36! or keyed |
| Bifid | fractionation | key optional, period | ✗ | 25! × period |
| Rail fence | transposition | rails | ✗ | ~n |
| Columnar | transposition | key | ✗ | n! |
| Enigma M3 | rotor | positions, rings, plugboard | ✓ | 26^6 × plugboard |
Conventions shared by all
- 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, not the historical 24. 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 them. Rotor has one member, and that one has enough settings for the rest.