Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. Rail Fence Cipher
(also called a zigzag cipher) generally refers to a form of
transposition cipher. It derives its name from the way in which it is
encoded.In the rail fence cipher, the plaintext is written downwards and
diagonally on successive "rails" of an imaginary fence, then moving up
when we reach the bottom rail. When we reach the top rail, the message
is written downwards again until the whole plaintext is written out. 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: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.The
term Zigzag cipher may refer to the Rail Fence Cipher as described
above. However, it may also refer to a different type of cipher system
that looks like a zigzag line going from the top of the page to the
bottom. As described in Fletcher Pratt's Secret and Urgent, it is
"written by ruling a sheet of paper in vertical columns, with a letter
at the head of each column.