## Secret Decoder Rings

When I was a young lad there was a very popular TV program called Captain Midnight and the Space Cadets (popular at least amongst youngsters such as myself.) Any viewer could write to Captain Midnight, and for a mere \$1, become a junior space cadet. For the \$1, you received an official scroll with your name on it declaring that you were a junior space cadet, an identification card and a secret decoder ring. Each week, at the end of the program, a secret message for junior space cadets was printed on the TV screen. It looked like a jumble of letters without any meaning, something like this:
 GULQN ERVFR LWV JRRG IRU BRX
However, any junior space cadet who had a secret decoder ring could figure out the secret message!

The ring was a plastic ring that you could slip on your finger. On the top of the ring were two circles, one inside the other, with the letters of the alphabet printed on them. The inner circle was fixed, but you could rotate the outer circle so that the letters on it would line up with the letters on the inner circle in different ways. The face of this ring looked like this:

Besides the secret message, we were also given the weekly secret setting for the ring. For instance, one week we would be told to rotate the outer circle until the letter M on the outer circle was next to the J on the inner circle. After the ring was set, we figured out the secret message by finding each letter of the secret message on the outer ring and replace it by the corresponding letter on the inner ring.

#### Find the secret message, using the picture of the decoder ring above, which has been set to the correct secret setting.

It was also possible for two junior space cadets to write secret messages to each other. All they had to do was to agree on a secret setting for their messages, such as "put the A on the outer circle next to the K on the inner circle" and keep this private information secret. To write a secret message to each other, they first set the ring with the secret setting, then taking each letter of the message they want to send (this is called the clear text) they find the letter on the inner circle and replace it with the corresponding letter on the outer circle. To read the secret message, the ring is set to the secret setting, then every letter of secret message is found on the outer circle and replaced by the corresponding letter on the inner circle, just as was done with the messages from the TV show.

These decoder rings are now hard to find, they have become collector's items. But, every once in a while you can still get one as a toy in a cereal box or a Cracker Jack box. However, we don't have to have secret decoder rings since we can use clock arithmetic to do the same thing that the decoder rings did.

Since we are going to use clock arithmetic, we need to convert the letters to numbers. We will always use the following table, both to convert letters to numbers and numbers back to letters (we will use this table often, so you might want to make your own copy of it):
 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
In order to create a secret message, we first pick a secret number between 0 and 25. This number corresponds to setting the decoder ring to its secret setting. Although you can pick the number 0, this will not be a good choice ... its like setting the A on the outer circle next to the A on the inner circle, then all the letters line up and the secret message is the same as the clear text. To write a secret message, for each letter of the clear text, first find the number that corresponds to this letter, then add the secret number to this mod 26, and then replace the original letter with the letter that corresponds to the new number. For example, suppose that the secret number is 3 and the clear text is the word "DRINK". Now "D" is 3, and 3 + 3 mod 26 = 6. 6 is the letter "G", so we replace "D" by "G". "R" is 17, 17 + 3 mod 26 = 20, and 20 is "U", so we replace "R" by "U". We continue in this way and the clear text "DRINK" becomes the secret message "GULQN". Notice that "J" = 9 becomes 12 = "M", so adding 3 corresponds to placing the "M" on the outer circle of the decoder ring over the "J" on the inner circle. This is the secret setting that is used in the picture of the decoder ring above. If you add 3 to the number corresponding to any letter on the inner ring, you will get the number corresponding to the letter on the outer ring. Also notice that "Y" = 24 on the inner ring, becomes 24 + 3 mod 26 = 27 mod 26 = 1 = "B" on the outer ring, so you really need to use clock arithmetic to get the right letters.

#### Use the given secret numbers to write the secret messages which correspond to these clear texts.

1. Secret number 5. THE MONEY IS IN THE DRAWER.
2. Secret number 10. THE QUICK RED FOX JUMPS OVER THE LAZY BROWN DOG.
3. Secret number 13. MEET ME AT THREE O CLOCK.

In order to figure out a secret message, when we know the secret number, we first convert the letters to numbers and then subtract the secret number mod 26, and finally convert back to letters. For example, if the secret number is 5, then the secret message DTZ FWJ XRFWY is figured out this way: "D" = 3, 3-5 mod 26 = -2 mod 26 = 24 ="Y", "T" = 19, 19-5 mod 26 = 14 = "O", "Z" = 25, 25 -5 mod 26 = 20 = "U", "F" = 5, 5-5 mod 26 = 0 = "A", "W" = 22, 22-5 mod 26 = 17 = "R", "J" = 9, 9-5 mod 26 = 4 = "E". So, our secret message starts out with YOU ARE ... now, figure out the rest of this secret message.

#### Use the given secret numbers to find out what these secret messages say.

1. Secret number 5. RFWYMF MFX GNL KJJY.
2. Secret number 10. S KW SX NKXQOB COXN ROVZ.
3. Secret number 13. ZRRD ZR NG DUERR B PYBPX.

You can now write secret messages to your friends, all you have to do is pick a different secret number to share with each friend. In the next section we'll see how to use more clock arithmetic to make an even better secret decoder ring (without the ring).

Secret Message

The message is, "DRINK BOSCO ITS GOOD FOR YOU".

I should explain: Bosco was the brand name of a chocolate malted powder that you mixed with milk to get a chocolate milk drink. Bosco was the sponsor of the Captain Midnight and the Space Cadets show. So, this secret message was really a commercial.

Answers to making secret messages questions

1. YMJ RTSJD NX NS YMJ IWFBJW
2. DRO AESMU BON PYH TEWZC YFOB DRO VKJI LBYGX NYQ
3. ZRRD ZR NG DUERR B PYBPX