Analysis and Implementation of Rail Fence Cipher Algorithm

Verified

Added on  2019/09/25

|3
|454
|342
Homework Assignment
AI Summary
This document details the implementation of the Rail Fence Cipher algorithm. The solution explains the encryption process, which involves writing the plaintext in a zigzag pattern based on a key value, and the decryption process, which reconstructs the original text from the ciphertext. The assignment covers how to implement the algorithm, including the creation of a table to arrange the characters. The document also highlights the weaknesses of the Rail Fence Cipher, such as its limited key space and vulnerability to attacks, making it unsuitable for secure communication. The document provides the necessary details to understand the practical application of the algorithm and its limitations in cryptography.
Document Page
Rail Fence Cipher :
The rail fence cipher algorithm is an easy to encrypt plaintext to cipher text; it jumbles up the order of
the letters of plain text based on key.
Encryption by implementing Rail Fence Cipher:
By implementing this algorithm we have to write our plaintext into zigzag lines across the page in
multiple rows and these rows are determined by user entered key; this key value should be greater than
one so that plaintext can write into zigzag lines and these number of lines are decided by key value.
And then we start writing the letters of plaintext diagonally down to the right until we reach the number
of rows specified by the key and then come back diagonally until we hit the first row again. This process
we will continues until we reach the end of the user entered plaintext.
Example:
Plaintext: ENGLAND 123
Key: 5
E 1
N X 2
G D 3
L N
A
Encrypted text will be: E1NX2GD3LNA
Here we write encrypted text row by row.
Decryption:
In this we reconstruct the diagonal grid using encrypted message. We write the cipher text, but leaving a
dash in place of the spaces and gradually, we replace all the dashes one by one with the corresponding
letters and read off the text from the table. Here first we create a table that is combination of row and
column and rows as the key is and columns as the length of cipher text then we place the first letter in
the top left square and dashes diagonally. And when we get back to top row, we place the letter in
cipher text and we will continue like this across the row.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
E 1
_ _ _
_ _ _
_ _
_
E 1
N X 2
_ _ _
_ _
_
E 1
N X 2
G D 3
_ _
_
E 1
N X 2
G D 3
L N
_
E 1
N X 2
G D 3
L N
A
And from this table we can collect all previous characters to get our original plaintext again by following
the diagonals value.
Disadvantages:
1. Rail fence Cipher is not very strong. It simply allows mixing up of characters in plain text to form
the cipher text m it offers essentially no communication security and will be shown that it can be
easily broken.
2. This cipher is not particularly secure, since there is limited number of usable keys and the
messages length needs to be at least twice the key.
Document Page
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]