Tools › Ciphers
Classical Ciphers
Atbash, Affine, keyword substitution, keyed Caesar, Vigenère, Beaufort, Autokey, Gronsfeld, Porta, one-time pad, Playfair, Four-square, Bifid, Trifid, Nihilist, Rail Fence, columnar, double and AMSCO transposition, route and scytale, Polybius, Bacon, ADFGX, ADFGVX and Pigpen, both ways as you type.
About this tool What it's for, how to use it and an example
What it's for
Encrypt and decrypt with the classical pencil-and-paper ciphers, from simple letter swaps to the field ciphers of the World Wars.
- When you’re solving a puzzle, escape room or geocache and know (or suspect) which cipher was used.
- When you’re setting one, and want to check that your ciphertext decodes as you meant.
- When you’re learning how these ciphers work: the square, alphabet or zigzag the cipher uses is shown under the result.
How to use it
Choose a cipher and a direction, then type in Input: the output changes as you type. The fields each cipher needs appear beside it (a keyword, Affine’s two numbers, the number of rails, Bacon’s alphabet), and they are remembered. Use output as input moves the result back to the top and flips the direction, to check a round trip.
- Substitution: Atbash (A↔Z, B↔Y), Affine (multiply and shift), keyword substitution, keyed Caesar (a shift along a keyword alphabet), Polybius square (each letter as row and column), Bacon (each letter as five A’s and B’s) and Pigpen (drawn as symbols).
- Polyalphabetic: Vigenère, Beaufort and Autokey shift each letter by the next letter of a key; Gronsfeld is Vigenère with a number as the key; Porta swaps the two halves of the alphabet, shifted by each pair of key letters, so the same key encrypts and decrypts. A one-time pad shifts by a random key as long as the text: Make a pad writes one into the keyword box.
- Two letters at a time: Playfair uses one 5 × 5 square, Four-square two keyed squares (keyword and second keyword).
- Fractionating: Bifid and Trifid split each letter into its coordinates in a square or a 3 × 3 × 3 cube and mix them, a period of letters at a time; Nihilist adds the Polybius numbers of the text and of a second keyword.
- Transposition: Rail Fence writes the text in a zigzag; columnar transposition writes it in rows and reads the columns in the keyword’s alphabetical order; double transposition does that twice, with two keywords; AMSCO fills the rows with one and two letters in turn; the route cipher reads the rows in a clockwise spiral; the scytale writes the text round a rod of so many turns.
- ADFGX and ADFGVX combine a 5 × 5 or 6 × 6 square with a columnar transposition.
Example
Choose Vigenère, keep the keyword LEMON, and type:
Attack at dawn
The output is Lxfopv ef rnhr. Choose Use output as input and it decrypts back to Attack at dawn.
Good to know
Playfair and Polybius merge J into I, and Playfair puts an X between doubled letters and on the end of an odd
number of letters (a Q if the letter is X), so decrypting shows those extra letters. Playfair, Polybius, Bacon,
ADFGVX and Pigpen work on letters only and drop punctuation; Rail Fence and columnar transposition move every
character you type, spaces included, so leave the spaces out for the traditional form. Bacon decrypts A’s and
B’s, or, for any other text, reads lower case as A and upper case as B, the way Bacon hid messages in type.
Pigpen only encrypts, as its symbols can’t be typed. The 5 × 5 squares (Playfair, Four-square, Bifid, Nihilist,
ADFGX) merge J into I; Trifid’s cube uses + as its 27th symbol; Four-square and the spiral route pad an odd or
short text with X. The newer transpositions work on letters only. A one-time pad is unbreakable only if its pad is
truly random, as long as the message and never used again; the keyword box is remembered in this browser, so
clear it afterwards. None of the other ciphers protects anything today.
Guide: Solving an unknown cipher
Private: this tool runs in your browser. Nothing you type, paste or choose leaves this page.
Saved you a few minutes? Say thanks with a coffee.
Something wrong with this tool, or missing from it? Report a bug or suggest a feature.