By · Updated

Classic Ciphers

Vigenère, Atbash, ROT47 and Rail Fence Decoder for Puzzles, Escape Rooms and Geocaches

No ratings yet

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Classic Ciphers works

This collection of classic ciphers covers the ones that turn up most in puzzles, geocaches and codebreaking lessons. Choose Vigenère or Beaufort with a keyword, Atbash or ROT47 with no key, or rail fence with a number of rails, then encode or decode as you type. Letter case, spaces and punctuation are kept.

The classic ciphers explained

Vigenère shifts each letter by the matching letter of a repeating keyword, so A shifts by 0 and C by 2. It resisted attack for three centuries. Beaufort subtracts the plaintext from the key letter instead, which makes encoding and decoding the same step. Atbash mirrors the alphabet, turning A into Z and B into Y. ROT47 rotates all 94 printable ASCII characters by 47, scrambling digits and symbols too.

Rail fence

Rail fence is a transposition cipher: letters are not changed, only reordered. The text is written in a zigzag across a number of rails and read off row by row. With 3 rails, WEAREDISCOVEREDFLEEATONCE becomes WECRLTEERDSOEEFEAOCAIVDEN. Enter the rail count in the key box.

Breaking them

None of these are secure today. Atbash and ROT47 have no key at all. Vigenère falls to the Kasiski test and index of coincidence, which find the keyword length from repeated fragments. Rail fence has so few possible keys that trying each one takes seconds.

FAQ

Which letters does the Vigenère keyword use?

Only A to Z count; spaces, digits and punctuation in the keyword are ignored, and case does not matter. The key advances only on letters of the message, so punctuation and spaces pass through unchanged and do not use up a key letter.

Why does Beaufort ignore the Encode and Decode choice?

Beaufort is reciprocal. Subtracting the plaintext from the key gives the ciphertext, and subtracting the ciphertext from the key gives the plaintext back, so one operation does both. It was used in this form in some cipher machines for exactly that convenience.

What is the difference between ROT13 and ROT47?

ROT13 rotates only the 26 letters by 13 places. ROT47 rotates every printable ASCII character from ! to ~ by 47 places, so numbers and symbols are hidden as well. Both are their own inverse. ROT13 is on the Caesar cipher page.

See also: all Security & Identifiers tools, Dev Utilities, Formatters & Validators, Data & Encoding, SEO, Accessibility, AI.

Related tools