Railfence

History

Used extensively by both sides during the American Civil War, the Railfence cipher is a transposition cipher also known as the zig-zag cipher and is said to have been used during the Middle Ages (before the 15th century).

Description

The cipher is one of the simplest of the transposition ciphers in which plaintext letters are written in a zig-zag pattern across a number of rows or 'rails' and starting on any row. The text is then read off across the rows to produce the ciphertext.

Example

Rails: 3

Starting offset: 1

Plaintext: It is easier to get older than it is to get wiser.

S I O O R N S E S

I I E S E T G T L E T A I I T G T I E

T A R E D H T O W R

Ciphertext: SIOOR NSESI IESET GTLET AIITG TIETA REDHT OWR

Solving

Solving method: Brute force search.

After selecting the Railfence cipher, the cipher period can be selected from the Setup drop down menu. The default setting of 0 means that all periods in the range 3 to 10 will be tested.