Rail Fence Cipher: Encode and Decode Online Rail fence cipher is a transposition cipher that encrypts by writing a text in zigzag and then read from left to right. It is also known as zigzag cipher. To put it simply, in rail fence cipher, the plaintext is written downwards on successive rails of an imaginary fence, and starting a new column when the bottom is reached. The message is then read off in rows. It was invented in ancient times, used by the Greeks through a tool called Scytale. It was also used back in the American Civil War by soldiers to encode messages. Today you can use this cipher with just a piece of paper. Use the above rail fence cipher decoder and encoder to encrypt/decrypt simple messages. If this tool was helpful, tweet it or share it.