Find adventure
My adventures Online Events Kits Boxes Challenges Shows Services Pages
Privacy Policy Terms of Use Sponsors About Contacts FAQ Pages Services Shows Boxes Kits Online Events My adventures

What is Rail Fence cipher?

The rail fence cipher (also called a zigzag cipher) is a classical type of transposition cipher. 

 

In the rail fence cipher, the plaintext is written downwards diagonally on successive "rails" of an imaginary fence, then moving up when the bottom rail is reached, down again when the top rail is reached, and so on until the whole plaintext is written out. The ciphertext is then read off in rows.

 

For example, to encrypt the message 'WE ARE DISCOVERED. RUN AT ONCE.' with 3 "rails", write the text as:

 

 

Then read off the text horizontally to get the ciphertext:

WECRUO ERDSOEERNTNE AIVDAC