I want a program build in C++ that use the playfair square to decrypt the message.
For example we have a 5x5 array
L M N O P
A B C D E
V W X Y Z
Q R S T U
F G H I K
If we have two letters W, I
We locate the letter W in the matrix and the letter I in the matrix
Then these two location form a box the 'W' encrypt s to' Y' and 'I' encrypts to 'G'
If the two letters are in the same row for example 'N' and 'O' the letter 'N'becomes 'M' and the letter 'O' becomes 'N'. If one of the characters was, say, a "V," which is already on the left, we would "wrap around" and use the "Z."
If the letters are in the same column for example 'T''I', T becomes 'Y', and 'I' becomes 'T' And once again, if the character were an "N," already on the top, we would wrap around and use the "H."
For the same letter, we go to the left. Take the pair (LL). L is on the leftmost edge of the matric. We cannot go any further to the left, so we wrap around. The pair "L" "L" becomes the pair "P" "P."