Encrypt or decrypt
The rail fence is a transposition cipher: letters zigzag across rails, then each rail is read in order.
The result appears below.
Encrypt and decrypt with the rail fence transposition cipher. Choose the number of rails; letters zigzag down and across the rails.
The rail fence is a transposition cipher: letters zigzag across rails, then each rail is read in order.
The result appears below.
The rail fence writes the message diagonally across a chosen number of rails, bouncing up and down, then reads each rail left to right. With 3 rails, WEAREDISCOVERED becomes WECRLTEERDSOEEFEAOCAIVDEN. The letters are only rearranged, never substituted, which makes it a transposition cipher.
The key space is tiny: only the rail count matters, and counts above half the message length are equivalent to smaller ones. Trying every rail count from 2 upward breaks any message in seconds, and anagramming finishes the job. It is a puzzle cipher, not protection.