# Rail Fence Cipher

## Information about Rail Fence Cipher

The Rail Fence Cipher is a form of transposition cipher that derives its name from the way in which it is encoded. In the rail fence cipher, the plaintext is written downwards on successive "rails" of an imaginary fence, then moving up when we get to the bottom. The message is then read off in rows. For example, if we have 3 "rails" and a message of 'WE ARE DISCOVERED. FLEE AT ONCE', the cipherer writes out: W . . . E . . . C . . . R . . . L . . . T . . . E . E . R . D . S . O . E . E . F . E . A . O . C . . . A . . . I . . . V . . . D . . . E . . . N . .

WECRL TEERD SOEEF EAOCA IVDEN

(A number of websites have mistakenly referred to a row-first complete rectangular transposition as being the Rail Fence - this seems to be a recent innovation. All of the older references are consistent in applying Rail Fence to this down-and-up transposition.

## Problems with the Rail Fence Cipher

The rail fence cipher is not very strong; the number of practical keys is small enough that a cryptanalyst can try them all by hand.

• Scytale
• Helen Fouché Gaines, "Cryptanalysis, a study of ciphers and their solution", Dover, 1956, ISBN 0-486-20097-3

American Cryptogram Association - Railfence

In classical cryptography, a transposition cipher changes one character from the plaintext to another (to decrypt the reverse is done). That is, the order of the characters is changed.
scytale (rhymes with Italy, and also transliterated as skytale, Greek σκυτάλη, a baton) is a tool used to perform a transposition cipher, consisting of a cylinder with a strip of leather wound around it on which is written a
In cryptography, the ADFGVX cipher was a field cipher used by the German Army during World War I. ADFGVX was in fact an extension of an earlier cipher called ADFGX. Invented by Colonel Fritz Nebel and introduced in March 1918, the cipher was a fractionating transposition
The Affine cipher is a special case of the more general substitution cipher. It is monoalphabetic and symmetric.

In affine ciphers the encryption function for a letter is where,
• and are coprime (otherwise would have no multiplicative inverse modulo ).

The Alberti Cipher was the first ever Polyalphabetic Cipher.

Created in the late 15th century, circa.1470, by Leon Battista Alberti, it was the peak of cryptography at that time.
Atbash is a simple substitution cipher for the Hebrew alphabet. It consists of substituting aleph (the first letter) for tav (the last), beth (the second) for shin (one before last), and so on, reversing the alphabet.
autokey cipher (also known as the autoclave cipher)[1] is a cipher which incorporates the message (the plaintext) into the key. There are two forms of autokey cipher: key autokey and text autokey ciphers.
In classical cryptography, the bifid cipher is a cipher which combines the Polybius square with transposition, and uses fractionation to achieve diffusion. It was invented around 1901 by Felix Delastelle.
A book cipher is a cipher in which the key is the identity of a book or other piece of text. It is generally essential that both correspondents not only have the same book, but the same edition.
Caesar cipher, also known as a Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques.
The Four-square cipher is a manual symmetric encryption technique. It was invented by famous French cryptographer Felix Delastelle.

The technique encrypts pairs of letters (digraphs
Hill cipher is a polygraphic substitution cipher based on linear algebra. Invented by Lester S. Hill in 1929, it was the first polygraphic cipher in which it was practical (though barely) to operate on more than three symbols at once.
A keyword is a monoalphabetic substitution. A keyword is thought of and then the letters of the alphabet are assigned a letter after the keyword has been decided. When the number of letters in the keyword has been assigned their encoded version, the rest of the alphabet is added to
In the history of cryptography, the Nihilist cipher is a manually operated symmetric encryption cipher originally used by Russian Nihilists in the 1880s to organise terrorism against the czarist regime.
In classical cryptography, a permutation cipher is a transposition cipher in which the key is a permutation.

To apply a cipher, a random permutation of size e is generated (the larger the value of e the more secure the cipher).
pigpen cipher (sometimes called the masonic cipher or Freemason's cipher) is a simple substitution cipher exchanging letters for symbols based on a grid. The use of symbols is no impediment to cryptanalysis however, and cryptanalysis is identical to that of other
Playfair cipher or Playfair square is a manual symmetric encryption technique and was the first literal digraph substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name of Lord Playfair who promoted the use of the cipher.
A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. The Vigenère cipher is probably the best-known example of a polyalphabetic cipher, though it is a simplified special case.
In cryptography, the Polybius square, also known as the Polybius checkerboard, is a device invented by the Ancient Greek historian and scholar Polybius, described in Hist. X.45.6 ff.
The Reihenschieber (German: Row Slider) was a hand cipher system used by Germany. It was developed during 1957 and used until the early 1960s, although information about the system was released publicly only in 1992. The system was used to encrypt high-grade messages.
Reservehandverfahren (RHV) (German: Reserve Hand Procedure) was a German Naval World War II hand-cipher system used as a backup method when no working Enigma machine was available.[1]

The cipher had two stages: a transposition followed by bigram substitution.
ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple Caesar cipher used in online forums as a means of hiding spoilers, punchlines, puzzle solutions, and offensive materials from the casual glance.
In classical cryptography, the running key cipher is a type of polyalphabetic substitution cipher in which a text, typically from a book, is used to provide a very long keystream.
scytale (rhymes with Italy, and also transliterated as skytale, Greek σκυτάλη, a baton) is a tool used to perform a transposition cipher, consisting of a cylinder with a strip of leather wound around it on which is written a
Smithy code is series of letters embedded, as a private amusement,[1] within the April 2006 approved judgement of Mr Justice Peter Smith on the The Da Vinci Code copyright case.