# Secret Codes #9

In *National Treasure: Book of Secrets*, Nicolas Cage is again embroiled in codes and puzzles that turn his life upside down. The movie opens with a frantic attempt to decode a Playfair cipher, another substitution cipher in the same general family as Caesar (Secret Codes #6). Letters are substituted for others, not just rearranged like the railfence cipher (Secret Codes #7).

Using a Playfair cipher (named after Lord Playfair who didn't invent it!) has a few more rules than the ciphers we've seen so far.

The key is written inside a 5x5 cube, one letter in each square and then the rest of the alphabet fills out the rest of the cube in order. Usually "I" and "J" share the same space. No letters are repeated.

Let's say the key is "GRAPEFRUIT". The cube used to encipher and decipher will look like this:

Notice there is no second "R" in "GRAPEFRUIT" because no letters are repeated and "J" is not listed because "I" is already there. This fits the English alphabet into a 5x5 matrix.

Now down to business. We want to encipher the message "The key is inside the old clock".

First we break down the plaintext into digraphs (groups of 2 letters) adding an X if we need to break up 2 of the same letters in a single digraph or finish a group of 2 letters:

TH EK EY IS IN SI DE TH EO LD CL OC KX

By comparing the letters in each digraph, we get the ciphertext.

- If the 2 letters of a digraph are in the same column, each letter substitutes for the letter below it.
- If the 2 letters are in the same row, each letter substitutes for the letter to the right of it.
- If the letters are diagonal and form a rectangle or square, letters substitute for the letters in the same row in the corners of the rectangle.

If you are at the end of a column or row, and need the letter below or to the right, wrap around and take the first letter in the column or row. Let's take a look at an example:

"T" and "H" form a square in the cube so get enciphered to "I" and "K" -- the opposite corners of the square. "I" is in the same row as "T" and "K" is in the same row as "H". The same with the digraph "E" and "K" which become "P" and "L" and so on.

The final ciphertext for our example is IK PL PZ BO UO OB LR IK AS CH DC MH HY

To decipher a message using the key, build the cube (carefully!) and then reverse the process for each digraph.

This badge has been awarded to 318 players

Sign in to see clues and check your progress on this badge

**Game**

SummerGame2021

**Difficulty**

★★★☆
3 of out 4 difficulty

**Badge Points**

100

## Comments

## im so confused can you…

im so confused can you explain how this works please

## Using the same letter square…

Using the same letter square as in the example, (the one that starts with G R A P E on the first line) compare each group of 2 letters in the cipher. The first group of 2 letters is NQ. Both letters are on the same horizontal line. So to DECIPHER the code, write the letter to the left of each one. So NQ becomes MO. For letters that are in the same vertical column, write the letter that is printed above each letter in the letter square. So UD becomes RU. Finally, if letters are diagonal from each other, write the letters in the opposite "corners" of the square that they might form, sticking to the same row. So QB becomes ST in the deciphered message. Good luck!

## Thank You So Much that…

Thank You So Much that really helped!!!!