On the Subject of the Playfair CM
A machine that knows no bounds when it comes to ciphers.
Create a key using the keyword on screen 1 and the Boolean Expression on screen A. Make sure to replace any Js with Is. Rearrange the key into a 5×5 matrix.
If there is a number on screen B, take out the letter at that position in the encrypted word. Set aside this letter to be put back in at a later step. Split the encrypted word into pairs of letters. Depending on which instruction is required, apply it to each pair of letters.
If the Submit Button is white, follow the instructions under Encrypt Instructions. Otherwise follow the instructions under Decrypt Instructions.
Encrypt Instructions
- If the 2 letters are the same, the encrypted pair is two of the letter diametrically opposite in the matrix.
- Otherwise, if the letters appear on the same row of your matrix, replace them with the letters to their immediate right respectively, wrapping around to the left side of the row.
- Otherwise, if the letters appear on the same column of your matrix, replace them with the letters immediately below them respectively, wrapping to the top row of the matrix.
- Otherwise, replace each of them with the letter on the same row but in the column of the other letter in the original pair.
Decrypt Instructions
- If the 2 letters are the same, the encrypted pair is two of the letter diametrically opposite in the matrix.
- Otherwise, if the letters appear on the same row of your matrix, replace them with the letters to their immediate left respectively, wrapping around to the right side of the row.
- Otherwise, if the letters appear on the same column of your matrix, replace them with the letters immediately above them respectively, wrapping to the bottom row of the matrix.
- Otherwise, replace each of them with the letter on the same row but in the column of the other letter in the original pair.