Rail Fence Cipher
From Wikipedia, the free encyclopedia
The Rail Fence Cipher is a form of transposition cipher that gets 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 . .
Then reads off:
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.
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
|
Classical cryptography
|
|---|
| Ciphers: ADFGVX | Affine | Alberti | Atbash | Autokey | Bifid | Book | Caesar | Four-square | Hill | Keyword | Nihilist | Permutation | Pigpen | Playfair | Polyalphabetic | Polybius | Rail Fence | Reihenschieber | Reservehandverfahren | ROT13 | Running key | Scytale | Smithy code | Solitaire | Straddling checkerboard | Substitution | Tap Code | Transposition | Trifid | Two-square | VIC cipher | Vigenère |
| Cryptanalysis: Frequency analysis | Index of coincidence |
| Misc: Cryptogram | Bacon | Polybius square | Scytale | Straddling checkerboard | Tabula recta |
| History of cryptography | Cryptanalysis | Cryptography portal | Topics in cryptography |
| Symmetric-key algorithm | Block cipher | Stream cipher | Public-key cryptography | Cryptographic hash function | Message authentication code | Random numbers |