Ciphers

Ciphers

Seventy-two ciphers in sixteen families. Each page has the options, the keyspace, the conventions and a vector you can check yourself.

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.

ciphers()72 ciphers · registry order
OptionsKeyspace
Caesar CiphercaesarclassicalShiftshift?25
ROT-13rot13classicalShiftnone1
ROT-47rot47classicalShiftnone1
AtbashatbashclassicalReflectionnone0
SubstitutionsubstitutionclassicalMixed alphabetkey26!
VigenèrevigenereclassicalPolyalphabetickey26^keyLength
GronsfeldgronsfeldclassicalPolyalphabetickey10^keyLength
BeaufortbeaufortclassicalPolyalphabetickey26^keyLength
PortaportaclassicalPolyalphabetickey, rotation?13^keyLength
AutokeyautokeyclassicalPolyalphabetickey26^keyLength
Running keyrunning-keyclassicalPolyalphabetickey26^textLength
TrithemiustrithemiusclassicalPolyalphabeticnonefixed
AlbertialberticlassicalPolyalphabetickey, periodnot stated
Quagmire Iquagmire-1classicalPolyalphabetickey, indicator, indicatorUnder?26! × 26^indicatorLength
Quagmire IIquagmire-2classicalPolyalphabetickey, indicator, indicatorUnder?26! × 26^indicatorLength
Quagmire IIIquagmire-3classicalPolyalphabetickey, indicator, indicatorUnder?26! × 26^indicatorLength
Quagmire IVquagmire-4classicalPolyalphabetickey, secondKey, indicator, indicatorUnder?(26!)² × 26^indicatorLength
ChaocipherchaocipherclassicalPolyalphabetickey, secondKey26! × 25!
Rail Fencerail-fenceclassicalTranspositionrails?~n
Affine CipheraffineclassicalMultiplicativea?, b?12 × 26 = 312
PlayfairplayfairclassicalDigraphkey25! ≈ 1.5×10²⁵
Four-squarefour-squareclassicalDigraphkey, secondKey, omit?(25!)² ≈ 2.4×10⁵⁰
Two-squaretwo-squareclassicalDigraphkey, secondKey, orientation?, omit?(25!)² ≈ 2.4×10⁵⁰
HillhillclassicalPolygraphickey157,248
Polybius SquarepolybiusclassicalFractionationkey?1
NihilistnihilistclassicalFractionationkey, square?25! squares times 25^n keys of n letters
Morse CodemorseclassicalFractionationnone1
Fractionated Morsefractionated-morseclassicalFractionationkey26!
Bacon's CipherbaconclassicalFractionationletters?2
Tap Codetap-codeclassicalFractionationnone1
A1Z26a1z26classicalFractionationseparator?, zero?1, or 17 in the single digit form
Book CipherbookclassicalHomophonicbook, address?, pick?, start?every text both sides have
Columnar TranspositioncolumnarclassicalTranspositionkeyn!
Route TranspositionrouteclassicalTranspositionwidth, corner?, path?~20n
ADFGVXadfgvxclassicalFractionationkey?, transposition?36! grids × n! column orders
Bifid CipherbifidclassicalFractionationkey?, period?25! × period variants
Straddling Checkerboardstraddling-checkerboardclassicalFractionationkey?, blanks?28! boards × 90 ordered pairs of blanks
Enigma M3enigmaclassicalRotorpositions?, rings?, plugboard?26^6 × plugboard configurations
AES (ECB)aesblockSP networkkey, bytes?2^128, 2^192 or 2^256
AES (CBC)aes-cbcblockSP networkkey, iv, bytes?2^128, 2^192 or 2^256
AES (CFB)aes-cfbblockSP networkkey, iv, segment?, bytes?2^128, 2^192 or 2^256
AES (OFB)aes-ofbblockSP networkkey, iv, bytes?2^128, 2^192 or 2^256
AES (CTR)aes-ctrblockSP networkkey, iv, bytes?2^128, 2^192 or 2^256
AES (CCM)aes-ccmblockSP networkkey, nonce, aad?, tagLength?, bytes?2^128, 2^192 or 2^256
AES (OCB)aes-ocbblockSP networkkey, nonce, aad?, tagLength?, bytes?2^128, 2^192 or 2^256
AES (LRW)aes-lrwblockSP networkkey, tweak?, bytes?2^256, 2^320 or 2^384
AES (XTS)aes-xtsblockSP networkkey, tweak?, bytes?2^256 or 2^512
AES (CBC-MAC)aes-cbc-macblockSP networkkey, bytes?2^128, 2^192 or 2^256
AES (passphrase)aes-passphraseblockSP networkkey, digest?, keyLength?, iterations?, salt?, bytes?set by the passphrase, not by keyLength
Rijndael (ECB)rijndaelblockSP networkkey, blockSize?, bytes?2^128 to 2^256
DES (ECB)desblockFeistelkey, bytes?2^56
DESX (ECB)desxblockFeistelkey, bytes?2^184
Triple DES (ECB)triple-desblockFeistelkey, bytes?2^112 or 2^168
Triple DES (CBC)triple-des-cbcblockFeistelkey, iv, bytes?2^112 or 2^168
Blowfish (ECB)blowfishblockFeistelkey, bytes?2^32 to 2^448
IDEA (ECB)ideablockLai-Masseykey, bytes?2^128
Lucifer (ECB)luciferblockFeistelkey, bytes?2^128
MARS (ECB)marsblockFeistelkey, bytes?2^128 to 2^448
Serpent (ECB)serpentblockSP networkkey, bytes?2^128, 2^192 or 2^256
CAST5 (ECB)cast5blockFeistelkey, bytes?2^40 to 2^128
Camellia (ECB)camelliablockFeistelkey, bytes?2^128, 2^192 or 2^256
ARIA (ECB)ariablockSP networkkey, bytes?2^128, 2^192 or 2^256
SM4 (ECB)sm4blockFeistelkey, bytes?2^128
OpenPGP (passphrase)openpgpblockSP networkkey, algorithm?, digest?, count?, salt?, iv?, bytes?set by the passphrase, not by the algorithm
RabbitrabbitstreamARXkey, iv?, endian?, bytes?2^128
RC4rc4streamPermutationkey, bytes?up to 2^2048
XORxorstreamPolyalphabetickey, bytes?256^n keys for an n-byte key
Salsa20salsa20streamARXkey, nonce, counter?, bytes?2^128 or 2^256
XSalsa20xsalsa20streamARXkey, nonce, counter?, bytes?2^256
ChaCha20chacha20streamARXkey, nonce, counter?, bytes?2^256
XChaCha20xchacha20streamARXkey, nonce, counter?, bytes?2^256
ChaCha20-Poly1305chacha20-poly1305streamARXkey, nonce, aad?, bytes?2^256
read from the registry in your browser / no networka name with ? is optional

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 full ciphers_info answer 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.