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