## On the Subject of The Crimson Cipher

Confusion will be my epitaph...

On the module, you will see 3 screens, a keyboard, 2 arrows, 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 are a total of 3 pages.

### Step 1: Transposed Halved Polybius Cipher

This step uses the encrypted word as well as the two keys on page 1; known as the fractionation key and the transposition key respectively.

To begin, take the fractionation key and enter it into the left half of the Halved Polybius Square in reading order, removing duplicates while keeping the first occurrences. Add the rest of the alphabet letter by letter, moving to the right half after running out of letters. The Halved Polybius Square is laid out like the diagram below.

 1 2 3 4 5 1 2 3 4 5 1 2 3 # # # # L R

Convert each letter of the encrypted word into three coordinates and write them out top to bottom in the order Half, Row, Column and to the right of any previous coordinates.

Then, for each letter of the transposition key, find it in the Halved Polybius Square and perform the following operation on the 6×3 matrix of coordinates you created.

• If you are at an odd step in the process, shift the row of that letter’s coordinate in the matrix to the left by the column coordinate.
• When doing this, do not move threes in the second row and fours and fives in the third row.
• If you are at an even step, start at the column of the matrix equal to the current key letter’s column coordinate, then continue counting columns to the right equal to the row coordinate, wrapping around if necessary. Swap the two columns received by this procedure.

Read off each column of the resulting matrix and index into the Halved Polybius Square to obtain your new encrypted word.

#### Example

Encrypted Word: BTYNJR
Transposition Key: ROUGH

 1 2 3 4 5 1 2 3 4 5 1 M O T I V J K L N P 2 A E B C D Q R S U W 3 F G H # # X Y Z # # L R
 LLRRRR213112332412 LLRRRR113221332412 LRLRRR131221323412 LRLRRR131122323412 LRLRRR121132313422 LRLRRR121132223413

New Encrypted Word: ORTNXS

### Step 2: Dual Triplex Reflector Cipher

This step requires the three keywords on page 2, as well as the first encrypted word. The first two keywords will be used to construct two triplex reflectors, while the third will be used to shuffle the reflectors after each encryption step.

To construct a triplex reflector, make a string by concatenating the keyword with the alphabet in that order, removing all second occurrences, and lay the string out in a 3×9 grid with a hole in the center. The triplex reflector made from the first keyword is the top reflector, and the one made from the second is the bottom reflector.

For each letter of the encrypted word, find it in the top reflector, then find the letter in the same position in the bottom reflector, which is your first intermediate letter. Find that letter in the top reflector, then find the letter in that position in the bottom reflector. Find that letter in the top reflector, which is your second intermediate letter, then find the corresponding letter in the decrypted word in the same position in the bottom reflector.

Note down the columns and rows you found the intermediate letters in, bearing in mind that the first intermediate letter was found in the bottom reflector and the second intermediate letter was found in the top reflector. Before decrypting the next letter, permute both reflectors as follows.

• Convert the alphabetic position of the current letter of the third key into ternary.
• If you are at an odd step, shift the row the first intermediate letter was found in to the left by the two most significant digits taken as a ternary number, and shift the column the second intermediate letter was found in down by the least significant digit.
• If you are at an even step, shift the column the first intermediate letter was found in down by the most significant digit, and the row the second intermediate letter was found in to the left by the two least significant digits taken as a ternary number.
• Do not move the hole when shifting the reflectors.

#### Example

Encrypted Word: ORTNXS
Keyword 3: LEASE

 S K I P E R A B C D F G H J L M N O Q T U V W X Y Z - - - - - - - - - J O K I N G L Y A B C D E F H M P Q R S T U V W X Z

O → Q → R → G
L → 12 → 110

 S K I P E R A B C D F G H J L M N O Q T U V W X Y Z - - - - - - - - - J O K I N G L Y A B C D E F H M P U V W X Z Q R S T

R → G → D → B
E → 5 → 012

 S K I P E R A B C L M N D F G H J O Q T U V W X Y Z - - - - - - - - - J O K I N G L Y A B C D E F H M P U V W X Z Q R S T

T → W → Q → V
A → 1 → 001

 S Q I P E R A B C L K N D F G H J O M T U V W X Y Z - - - - - - - - - J O K I N G L Y A B C D E F H M P U V W X Z Q R S T

N → D → E → N
S → 19 → 201

 Q I P E R A B C S L K N D F G H J O M T U V W X Y Z - - - - - - - - - J O D I N G L Y A B C W E F H M P U V K X Z Q R S T

X → R → N → W
E → 5 → 012

 Q I N E R A B C S L K T D F G H J O M P U V W X Y Z - - - - - - - - - J O D I N G L Y A B C W E F H M P V K X Z Q R S T U

S → A → G → H

### Step 3: Caesar Shuffle Cipher

This step requires the encrypted word from step 2 and the two five-letter keywords from page 3.

Perform the following steps for each letter of both keywords:

• Place a pivot after the Xth letter in the encrypted word where X is equal to the current letter of the first key’s alphabetic position, modulo 5, plus 1. Swap the 2 strings to the left and right of the pivot.
• Shift the now-left substring forwards in the alphabet by the current letter of the second key. Remove the pivot.

#### Example

Encrypted Word: GBVNWH
Keyword 1: GROSS
Keyword 2: CRASS

GBV.NWH → NWH.GBV → QZK.GBV → QZKGBV

QZKG.BV → BV.QZKG → TN.QZKG → TNQZKG

T.NQZKG → NQZKG.T → ORALH.T → ORALHT

ORALH.T → T.ORALH → M.ORALH → MORALH

MORAL.H → H.MORAL → A.MORAL → AMORAL

Decrypted Word: AMORAL

Once completed, the result is your decrypted word, which you can now submit. 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.