## On the Subject of Encrypted Morse

Oh nice, a Morse module! Wait, what does HNWLIREAKHI mean?

• This module contains a Morse light that transmits one of two things: The encrypted message (orange light) or the key (blue light). The defuser can choose which of these to receive using the knob next to the Morse light.
• There is also a binary display that shows a sequence of 42 binary digits (sequence A).
• The defuser may at any time press the small reset button in the middle of the module to restart the transmission from the beginning, as well as erase all inputted symbols.
• The wires leading to the Morse light may also be pressed to disable/enable it.

### Step 1: Generating sequence B

For every character of the serial number, generate a 7-digit binary number using the following rules, then concatenate them into a 42-digit binary string. That is sequence B.

• If the character is a digit, use its binary representation, extended to 7 digits. Example: 2 = 0000010 and 5 = 0000101.
• If the character is a vowel, use 1011001.
• Otherwise, if the character is positioned in the alphabet before the letter O, use 1100010.
• Otherwise, use 1000100.

If the total number of batteries on the bomb equals the total number of ports, reverse the first half of sequence B.

### Step 2: Binary decryption

Treat the received Morse message as a continuous sequence of Morse symbols
(. or -), omitting any spaces between letters.
For every symbol in that sequence, let A be the binary digit from sequence A at the same position. B is the corresponding digit from sequence B.
Use that information with the following table to decrypt the symbol. "Space" refers to a space between Morse letters.

AB.-
00Space-
01-.
10.-
11.Space
Parse the decrypted Morse message to get your intermediate result.
If this intermediate message contains more than one vowel, swap the first and fifth characters and the second and eighth characters in both the intermediate message and the received key.

### Step 3: Alphabetic decryption

For every letter in your intermediate result:

• Take the letter from the received key at the same position.
• Add the alphabetic positions of your message letter to the alphabetic position of the key letter (A=1, Z=26).
• If the result is greater than 26, subtract 26.
• Convert the result to the letter at that alphabetic position.

You now have the fully decrypted message.

### Step 4: Response

Find the correct response to send in the following table. Note that spaces and punctuation are added for readability, they are irrelevant in both message and response.

MessageResponseMessageResponse
“SHE SELLS”“SEA SHELLS”“KEEP TALK”“NO EXPLODE”

To defuse the module, convert the correct response to Morse code and use the two large buttons on the module to transmit it. Spaces between words and letters are not required. Transmitting a wrong Morse symbol at any time will cause a strike and you will have to restart the transmission from the beginning.

### Appendix A: Morse Code and binary conversion

DigitBinary
00000000
10000001
20000010
30000011
40000100
50000101
60000110
70000111
80001000
90001001

The optimized portion begins in the next page.

## Encrypted Morse, The Optimization

• Because there are only 8 possible messages to decrypt to, the expert may not need the entire sequence at all.
• Obtain the first 21 bits from the display for Sequence A.
• Obtain the first 21 bits from the serial number for Sequence B, while accounting for the condition in step 1.
• Grab as many Morse characters from the encrypted message as needed to decrypt. You may not need all of the characters.
• Use the table on the top of page 2 to obtain your intermediate result. You should have 4 letters in the intermediate result at this point. Ignore the condition for swapping the characters until the very end.
• Switch to the key and read out the Morse to obtain the first 4 characters of the key sequence.
• Apply step 3 using only the 4 pairs provided, with each pair consisting of a character from the intermediate result and the key. You should have 4 letters that are decrypted.
• Now using the table provided, find the 4 relevant letters from the Original Message Portion column to obtain your Morse sequence to submit. Note that the portion of the decrypted messages are also adjusted in a case where in the full intermediate sequence, there are multiple vowels present.
• This method can be done with 3 letters instead of 4.
Original Message Original Message Portion Response in Morse (without spaces) Response