Question: The Playfair cipher ( encryption ) uses a 5 by 5 table containing a key word or phrase. Memorization of the keyword and 4 simple

The Playfair cipher (encryption) uses a 5 by 5 table containing a key word or phrase. Memorization of the keyword and 4 simple rules was all that was required to create the 5 by 5 table and use the cipher. To generate the key table, one would first fill the table with the letters of the keyword (dropping any duplicate letters), then fill the remaining cells of the table with the rest of the letters of the alphabet in order (putting both "I" and "J" in the same cell).
To encrypt a message, one would break the message into digraphs (groups of 2 letters) such that, for example, "HelloWorld" becomes "HE LL OW OR LD", and map them out on the key table. If needed, append an "X" to complete the final digraph. Then apply the following 4 rules, in order, to each pair of letters in the plaintext:
If both letters are the same (or only one letter is left), add an "X" after the first letter. Encrypt the new pair and continue.
If the letters appear on the same row of your table, replace them with the letters to their immediate right respectively (wrapping around to the left side of the row if a letter in the original pair was on the right side of the row).
If the letters appear on the same column of your table, replace them with the letters immediately below respectively (wrapping around to the top side of the column if a letter in the original pair was on the bottom side of the column).
If the letters are not on the same row or column, replace them with the letters on the same row respectively but at the other pair of corners of the rectangle defined by the original pair. The order is important - the first letter of the encrypted pair is the one that lies on the same row as the first letter of the plaintext pair.
For example, to encrypt the pair 'OR', three configurations could occur in the table:
on the same line
hence ORYZ
hence ORBY
rectangle shape
hence OR Zx
Example :
Suppose the key is "exemple playfair", the matrix must be filled as follows:
E X M P L
A Y F I R
B C D G H
J K N K Q
ST U V Z
The clear message message "Cache l'or dans la souche de l'arbre":
CA CH EL OR DA NS LA SO UC HE DE LA RB RE
in encrypted as:
BY DB XE QI BF JU ER VJ TD BL BM ER AH AL.Write a program in C# that reads from keyboard the encryption key and a message to encrypt, and proceeds the encryption and then displays the ciphered text.
The Playfair cipher ( encryption ) uses a 5 by 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!