On the Subject of the Maroon Cipher

I bet you will feel like a maroon trying to tackle this cipher.

On the module, you will see 3 screens, a keyboard, 2 buttons with a letter on it, and a submit button that displays the current page you're on.

Pressing the right arrow takes you to the next page. Pressing the left arrow takes you to the previous page. There is a total of 2 pages.

On page 1, the top screen shows a 6 letter encrypted word, the middle and bottom screens shows a word.

On page 2, the top screen shows a letter followed by 3 Roman numerals, the middle screen shows 3 letters, and the bottom screen shows some letter pairs.

Step 1: Monoalphabetic Cipher

For this, you're going to need the encrypted word on the top screen and the keyword on the middle screen on page 1.

Remove any duplicate letters from the keyword (keep each letter’s first occurrence). Take the entire alphabet and remove any letters that are in the keyword.

If the number of ports modulo 4 is 0 or 1, place the alphabet at the end of the keyword. Otherwise, place the alphabet at the beginning of the keyword. This is the alphabet key. Place a 2nd alphabet underneath the alphabet key.

For each letter of the encrypted word, find the letter in the alphabet key and replace it with the letter directly below the alphabet key.

The resulting letters will become your new encrypted word.

Example

Encrypted Word: TTNKDM

BCDFGHIJKLMOPQRSUVWXYZNEAT
ABCDEFGHIJKLMNOPQRSTUVWXYZ

TTNKDM -> ZZWICK

New Encrypted Word: ZZWICK

Step 2: Redfence Transposition

For this, you will need the encrypted word you got from step 1 and the number key from the bottom screen of page 1.

Place down 6 asteriks in a zig zag pattern with the number of rows equal to the length of the number key:

Example

Key: 312
1:   *       *   
2:     *   *   *
3:        *       

For each encrypted letter, replace each asterik on that line. Each number in the key determines the order of the lines to be filled in.

Finally read the letters in the same order you place the asteriks, up and down, left to right.

You should now have a new encrypted word.

Example

Encrypted word: ZZWICK
Key: 312
1:   Z       W   
2:     I   C   K
3:        Z       
New Encrypted Word: ZIZCWK

A00000
B00001
C00010
D00011
E00100
F00101
G00110
H00111
I01000
J01001
K01010
L01011
M01100
N01101
O01110
P01111
Q10000
R10001
S10010
T10011
U1010
V1011
W1100
X1101
Y1110
Z1111
200
301
410
511
60
71

Step 3: Modified Huffman Cipher

Concatenate the encrypted word from step 2 and the top, middle, and bottom screens on page 2 in that order. Convert this encoded string to binary by replacing each character with a binary code from the table on the right.

For each bit of the binary string until you run out of letters in the alphabet key, do the following:

  • 1: Create a number node. If you have more than 1 number node, find the most recently created number node before this node that doesn't contain 2 characters and put in the number node you just created into that number node.
  • 0: Put in the leftmost letter from the alphabet key inside the node that was created most recently that doesn't contain 2 characters. Remove that letter from the alphabet key.

Example

Encrypted Word: ZIZCWK
Alphabet Key: BCDFGHIJKLMOPQRSUVWXYZNEAT
Top/Middle/Bottom Screens: UPET EDJP WKBZ7
Binary String:
1111010001111000101100010101010011110010010
011001000001101001011111100010100000111111

01, 169J, 101819, 20
12, 51011, M19U, V
23, F11K, L20W, X
3B, 412O, 1321Y, Z
4C, D13P, 142223, 24
56, 1214Q, 1523N, E
67, 915R, S24A, T
78, I1617, 22
8G, H1718, 21

Leftover: 0001101001011111100010100000111111

Start at the first created number node. This will be called the root from now on.

Read the first bit from the leftover binary. If it's a 0, move to the left character, else the right character.

If it's a number, go to that number node. If it's a letter, write down the letter and go back to the root.

Repeat until all bits in the encrypted binary are exhausted. The received letters form the deciphered word.

Example

Leftover: 0001101001011111100010100000111111

0 + 0 -> 1 + 0 -> 2 + 0 -> 3 + 1 -> 4 + 1 -> D
0 + 0 -> 1 + 1 -> 5 + 0 -> 6 + 0 -> 7 + 1 -> I
0 + 0 -> 1 + 1 -> 5 + 1 -> 12 + 1 -> 13 + 1 -> 14 + 1 -> 15 + 1 -> S
0 + 0 -> 1 + 0 -> 2 + 0 -> 3 + 1 -> 4 + 0 -> C
0 + 1 -> 16 + 0 -> 17 + 0 -> 18 + 0 -> 19 + 0 -> U
0 + 0 -> 1 + 1 -> 5 + 1 -> 12 + 1 -> 13 + 1 -> 14 + 1 -> 15 + 1 -> S

Decrypted Word: DISCUS

Once you finally have your decrypted word, you can submit it. Once you start typing, all the screens will go black and the bottom screen will show what you are typing.

To clear it, just click one of the arrows. This goes to one of the pages and clears any input you put in. It will not let you go over 6 letters on input.

Once you are satisfied with your input, press the button labeled "SUB" to submit your answer. On a strike, the module will go back to the first page of the module, but it does not regenerate.