Ask a question to Desklib · AI bot

Ask NowBETA

Rail Fence Cipher :.

Added on -2019-09-25

| 3 pages
| 454 words
| 342 views

Trusted by 2+ million users,
1000+ happy students everyday

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 thanone 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 numberof 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 123Key: 5E1NX2GD3LNAEncrypted text will be: E1NX2GD3LNAHere 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 adash 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.

Found this document preview useful?

You are reading a preview
Upload your documents to download
or
Become a Desklib member to get accesss

Students who viewed this