In rail fence, the plaintext is written diagonally on a successive rails of an imaginary fence. Move up if you reached the bottom rail then move down if you reached the top rail and so on, until all the plaintext was written.
It depends on how many rails you're going to use.For my example, I'll use 3 rails
Plaintext: ice districti . . . i . . . i
. c . d . s . r . c
. . e . . . t . . . t-The ciphertext is read off in rows
Ciphertext: IIICDSRCETT
This time, I'll use 4 rails
i . . . . . t
. c . . . s . r
. . e . i . . . i . t
. . . d . . . . . cCiphertext: ITCSREIICDT
~~~CTTRO
![](https://img.wattpad.com/cover/242426647-288-k229015.jpg)