

"THEY ARE ATTACKING FROM THE NORTH".The Rail Fence Cipher involves writing messages so that alternate letters are written on separate upper and lower lines. Now, we read them as diagonally from top to bottom then bottom to top and we get the plain text or the original text i.e. Continuing to fill the rows you get the pattern below,Īs we have a key size of 4 and the length of the message is 28 so we make like this and continues this till all the text does not fit into it.įorth and the final stage in decrption process, You then dash the diagonal down places until you get back to the top line, and place the "E" here. We start by placing the "T" in the first square. If we get the ciphertext "TEKOOHRACIRMNREATANFTETYTGHH", it will be encrypted with a key size of 4. After filling the text, we traverse the matrix in the zig-zag form to get the original text or the plain text.

The plaintext we have i.e "defend the east wall" having a key size or the size of the row is 3, we get the encryption method below, When all the alphabet is fill in the rail then the individual's rows are combined together to give a ciphertext.Thus the alphabets of the plain text are written in a zig-zag form.

When we reach the bottom rail, we simply traverse opposite moving diagonally, after reaching the top rail or top line, the direction is changed again.In the rail fence cipher, the plain-text is written as zigzag way as firstly go downward till the box is not end and diagonally on successive rails of an imaginary fence.In a transposition cipher, the order of the alphabets is mixed up or we can say rearrange to obtain the cipher-text or encrypted text. The rail fence cipher works by writing your plain text or message on alternate lines across the prail and then reading off each line or rows in turn by turn. It derives its name from how it is encrypted. It is a form of transposition cipher that jumbles up the order of the letters of a message using a basic algorithm. The rail fence cipher is also called a "zigzag cipher" because we make a rectangle box and write plain text into it in a zigzag form. In Rail Fence Cipher, given a plain-text message and a numeric key then cipher/decipher the given text using the Rail Fence algorithm. Submitted by Monika Sharma, on January 09, 2020 We will cover types of messages in Rail Fence cipher. In this article, we will briefly study the basic Rail Fence cipher and examples aim to capture. This article is about the Rail Fence Cipher.
