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.
| Options | Keyspace | |||
|---|---|---|---|---|
| Caesar Ciphercaesar | classical | Shift | shift? | 25 |
| ROT-13rot13 | classical | Shift | none | 1 |
| ROT-47rot47 | classical | Shift | none | 1 |
| Atbashatbash | classical | Reflection | none | 0 |
| Substitutionsubstitution | classical | Mixed alphabet | key | 26! |
| Vigenèrevigenere | classical | Polyalphabetic | key | 26^keyLength |
| Gronsfeldgronsfeld | classical | Polyalphabetic | key | 10^keyLength |
| Beaufortbeaufort | classical | Polyalphabetic | key | 26^keyLength |
| Portaporta | classical | Polyalphabetic | key, rotation? | 13^keyLength |
| Autokeyautokey | classical | Polyalphabetic | key | 26^keyLength |
| Running keyrunning-key | classical | Polyalphabetic | key | 26^textLength |
| Trithemiustrithemius | classical | Polyalphabetic | none | fixed |
| Albertialberti | classical | Polyalphabetic | key, period | not stated |
| Quagmire Iquagmire-1 | classical | Polyalphabetic | key, indicator, indicatorUnder? | 26! × 26^indicatorLength |
| Quagmire IIquagmire-2 | classical | Polyalphabetic | key, indicator, indicatorUnder? | 26! × 26^indicatorLength |
| Quagmire IIIquagmire-3 | classical | Polyalphabetic | key, indicator, indicatorUnder? | 26! × 26^indicatorLength |
| Quagmire IVquagmire-4 | classical | Polyalphabetic | key, secondKey, indicator, indicatorUnder? | (26!)² × 26^indicatorLength |
| Chaocipherchaocipher | classical | Polyalphabetic | key, secondKey | 26! × 25! |
| Rail Fencerail-fence | classical | Transposition | rails? | ~n |
| Affine Cipheraffine | classical | Multiplicative | a?, b? | 12 × 26 = 312 |
| Playfairplayfair | classical | Digraph | key | 25! ≈ 1.5×10²⁵ |
| Four-squarefour-square | classical | Digraph | key, secondKey, omit? | (25!)² ≈ 2.4×10⁵⁰ |
| Two-squaretwo-square | classical | Digraph | key, secondKey, orientation?, omit? | (25!)² ≈ 2.4×10⁵⁰ |
| Hillhill | classical | Polygraphic | key | 157,248 |
| Polybius Squarepolybius | classical | Fractionation | key? | 1 |
| Nihilistnihilist | classical | Fractionation | key, square? | 25! squares times 25^n keys of n letters |
| Morse Codemorse | classical | Fractionation | none | 1 |
| Fractionated Morsefractionated-morse | classical | Fractionation | key | 26! |
| Bacon's Cipherbacon | classical | Fractionation | letters? | 2 |
| Tap Codetap-code | classical | Fractionation | none | 1 |
| A1Z26a1z26 | classical | Fractionation | separator?, zero? | 1, or 17 in the single digit form |
| Book Cipherbook | classical | Homophonic | book, address?, pick?, start? | every text both sides have |
| Columnar Transpositioncolumnar | classical | Transposition | key | n! |
| Route Transpositionroute | classical | Transposition | width, corner?, path? | ~20n |
| ADFGVXadfgvx | classical | Fractionation | key?, transposition? | 36! grids × n! column orders |
| Bifid Cipherbifid | classical | Fractionation | key?, period? | 25! × period variants |
| Straddling Checkerboardstraddling-checkerboard | classical | Fractionation | key?, blanks? | 28! boards × 90 ordered pairs of blanks |
| Enigma M3enigma | classical | Rotor | positions?, rings?, plugboard? | 26^6 × plugboard configurations |
| AES (ECB)aes | block | SP network | key, bytes? | 2^128, 2^192 or 2^256 |
| AES (CBC)aes-cbc | block | SP network | key, iv, bytes? | 2^128, 2^192 or 2^256 |
| AES (CFB)aes-cfb | block | SP network | key, iv, segment?, bytes? | 2^128, 2^192 or 2^256 |
| AES (OFB)aes-ofb | block | SP network | key, iv, bytes? | 2^128, 2^192 or 2^256 |
| AES (CTR)aes-ctr | block | SP network | key, iv, bytes? | 2^128, 2^192 or 2^256 |
| AES (CCM)aes-ccm | block | SP network | key, nonce, aad?, tagLength?, bytes? | 2^128, 2^192 or 2^256 |
| AES (OCB)aes-ocb | block | SP network | key, nonce, aad?, tagLength?, bytes? | 2^128, 2^192 or 2^256 |
| AES (LRW)aes-lrw | block | SP network | key, tweak?, bytes? | 2^256, 2^320 or 2^384 |
| AES (XTS)aes-xts | block | SP network | key, tweak?, bytes? | 2^256 or 2^512 |
| AES (CBC-MAC)aes-cbc-mac | block | SP network | key, bytes? | 2^128, 2^192 or 2^256 |
| AES (passphrase)aes-passphrase | block | SP network | key, digest?, keyLength?, iterations?, salt?, bytes? | set by the passphrase, not by keyLength |
| Rijndael (ECB)rijndael | block | SP network | key, blockSize?, bytes? | 2^128 to 2^256 |
| DES (ECB)des | block | Feistel | key, bytes? | 2^56 |
| DESX (ECB)desx | block | Feistel | key, bytes? | 2^184 |
| Triple DES (ECB)triple-des | block | Feistel | key, bytes? | 2^112 or 2^168 |
| Triple DES (CBC)triple-des-cbc | block | Feistel | key, iv, bytes? | 2^112 or 2^168 |
| Blowfish (ECB)blowfish | block | Feistel | key, bytes? | 2^32 to 2^448 |
| IDEA (ECB)idea | block | Lai-Massey | key, bytes? | 2^128 |
| Lucifer (ECB)lucifer | block | Feistel | key, bytes? | 2^128 |
| MARS (ECB)mars | block | Feistel | key, bytes? | 2^128 to 2^448 |
| Serpent (ECB)serpent | block | SP network | key, bytes? | 2^128, 2^192 or 2^256 |
| CAST5 (ECB)cast5 | block | Feistel | key, bytes? | 2^40 to 2^128 |
| Camellia (ECB)camellia | block | Feistel | key, bytes? | 2^128, 2^192 or 2^256 |
| ARIA (ECB)aria | block | SP network | key, bytes? | 2^128, 2^192 or 2^256 |
| SM4 (ECB)sm4 | block | Feistel | key, bytes? | 2^128 |
| OpenPGP (passphrase)openpgp | block | SP network | key, algorithm?, digest?, count?, salt?, iv?, bytes? | set by the passphrase, not by the algorithm |
| Rabbitrabbit | stream | ARX | key, iv?, endian?, bytes? | 2^128 |
| RC4rc4 | stream | Permutation | key, bytes? | up to 2^2048 |
| XORxor | stream | Polyalphabetic | key, bytes? | 256^n keys for an n-byte key |
| Salsa20salsa20 | stream | ARX | key, nonce, counter?, bytes? | 2^128 or 2^256 |
| XSalsa20xsalsa20 | stream | ARX | key, nonce, counter?, bytes? | 2^256 |
| ChaCha20chacha20 | stream | ARX | key, nonce, counter?, bytes? | 2^256 |
| XChaCha20xchacha20 | stream | ARX | key, nonce, counter?, bytes? | 2^256 |
| ChaCha20-Poly1305chacha20-poly1305 | stream | ARX | key, nonce, aad?, bytes? | 2^256 |
Three kinds
Classical ciphers work on letters and keep everything else in place. Caesar, Vigenère, Playfair, Morse, Enigma and friends. Block ciphers work on bytes and answer in hex, from DES to Serpent with every AES mode on the way. Stream ciphers work on bytes too, but grow a keystream and XOR it in, no blocks and no padding. That's Rabbit, RC4 and XOR. Then Salsa20, ChaCha20 and their kin. Same encode, same decode, same CipherResult, but a very different idea of what the text is. Each kind has its own tab in the header, so the menu stays short however many ciphers join.
What every page says
- The record at the top is read off
info()in your browser, so it can't drift from the code. The fullciphers_infoanswer sits behind its last row. - The options come with their defaults and what they do, then a vector you can check yourself, taken from the library, a standard or the original paper.
- The conventions a puzzle answer depends on, like which letters share a cell or what happens to a short last block, are spelled out instead of left for you to guess.