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.

Split the encrypted word into pairs of letters. If there is an odd amount of letters, leave the last letter as the odd letter. 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.

Finally, if any of the letters on screen 2 match at the same position as any of the letters of your encrypted word, replace that letter with a J. You should now have an decrypted word.

Example 1

Encrypted Word: BWTTY
Screen 2: FVFPU
Key: SAVORBCDEFGHIKLMNPQTUWXYZ
Using Encrypt Rules

BW → CU
TT → BB
CUBBY + FVFPU → CUBBY
Decrypted Word: CUBBY

Example 2

Encrypted Word: ODXLTDDP
Screen 2: SYOCCSXB
Key: MAGZINEBCDFHKLOPQRSTUVWXY
Using Decrypt Rules

OD → DI
XL → SC
TD → OI
DP → NT
DISCOINT + SYOCCSXB → DISJOINT
Decrypted Word: DISJOINT

Example 3

Encrypted Word: CHKHLZD
Screen 2: QCCRBSN
Key: ACFGHIKLMNOPQRSTUVXYZWEBD
Using Encrypt Rules

CH → FA
KH → NC
LZ → IE
FANCIED + QCCRBSN → FANCIED
Decrypted Word: FANCIED