CIPHERNAUT
Cipher catalogue
TranspositionDifficulty: Medium

Rail fence cipher

Write the message in a zigzag across several fence rails, then read it off rail by rail. Tidy text turns into apparent chaos.

Try it

27 characters

Result · Rail fence cipher

SESETLERTESGFRHCUCMAOEB

How it works

  1. 1Choose the number of rails, for example 3, and write the message without spaces.
  2. 2Place the letters diagonally down to the bottom rail, then diagonally back up, like stitching a zigzag.
  3. 3Read the first rail left to right, then the second, then the third. The joined text is the ciphertext.
  4. 4Example: WEAREDISCOVERED on 3 rails gives WECRERDSOEEAIVD.
  5. 5To decode, count how many letters fall on each rail, split the ciphertext into those parts and walk the zigzag again.

Example

We are discovered

WECRERDSOEEAIVD

Did you know

The rail fence cipher is a simple transposition named after the zigzag that resembles a split-rail fence. It is often described as a field cipher of the American Civil War, as it can be done with pencil and paper only. The only key is the number of rails, so every option can be tried by hand.

Try to decode

This message is encrypted with Rail fence cipher using the default settings:

ACDTAKTANTAW

Hint

The cipher uses 3 rails and spaces were left out.

Show solution

ATTACK AT DAWN

More ciphers in this category