## On the Subject of The Forest Cipher

Trees, shrubs, wildlife and ... rotations?

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 is a total of 2 pages.

### Step 1: Chain Bit-Rotation Cipher

For this step, you will need everything on page 1, which we will call the encrypted word, the initial number, and the keyword, respectively. If the keyword is shorter than 6 letters, append a repetition of it to it.

Start with the initial number, then carry out the following steps for every letter of the encrypted word: (1) multiply the number by 26; (2) add the alphabetic position of the letter. If the letter is Z, add 0 instead.

Convert this number to binary. Now, starting with a value n of 30, carry out the following steps 6 times:

• Cycle the least significant n bits to the right by m bits. Here, m is the alphabetic position of the next letter in the keyword. (Make sure to cycle all n bits; if your number has fewer digits, add leading zeros.)
• Remove the least significant 5 bits from the number and convert them to a letter (A = 00001 ... Z = 11010).
• Reduce n by 5.

#### Example

Encrypted word: XOGXTU; initial value: 2; keyword: DINE
Calculation: (((((2×26 + 24)×26 + 15)×26 + 7)×26 + 24)×26 + 20)×26 + 21
Binary: 110110001111010010110110000101

Cycle 30 bits right by D=4: 010111011000111101001011011000 → 24 → X
Cycle 25 bits right by I=9: 0100101100101110110001111 → 15 → O
Cycle 20 bits right by N=14: 11001011101100010010 → 18 → R
Cycle 15 bits right by E=5: 110001100101110 → 14 → N
Cycle 10 bits right by D=4: 1001110001 → 17 → Q
Cycle 5 bits right by I=9: 00111 → 7 → G

New Encrypted Word: XORNQG

### Step 2: Semaphore Rotation Cipher

For this step, you need the encrypted word obtained from step 1 and the keyword from the top screen on page 2.

Convert each letter of the encrypted word to semaphores using the table below.

 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

Then rotate each letter counter-clockwise by 45° times the alphabetic position of the corresponding letter in the keyword.

Convert the result from semaphores back into a letter.

#### Example

Encrypted word: XORNQG; keyword: LOUDER

 X O R N Q G L540° O675° U945° D180° E225° R810° I T L U E W

New Encrypted Word: ITLUEW

### Step 3: Monoalphabetic Rubik’s Cube Cipher

This step uses the encrypted word from step 2 and the keywords on the middle (keyword A) and bottom (keyword B) screens on page 2.

First, create an alphabet key from keyword A. Append the full alphabet to it, then remove all duplicate letters (retain first occurrences).

Create two 3×3×3 cubes. The first, cube A, should be filled with letters A–Z as shown in the diagrams below (note that the center cubelet is omitted). The second, cube B, must be filled with the alphabet key in the order in which the below diagrams have the letters KENVMPABCDFGHIJLOQRSTUWXYZ. (Mnemonic: fill the face centers first in the below order, then the rest of the front, middle and back layers in reading order as seen from the front.)

For each letter of keyword B, perform one of the below rotations on cube B (meaning: cycle the eight highlighted letters in the indicated direction, which is always clockwise when looking toward the relevant face of the cube) a number of times as given by the table underneath.

 Letter from keyword B Number of cycles AEIMQUY BFJNRVZ CGKOSW DHLPTX 1 3 5 7

Finally, find each letter of the encrypted word in cube B and replace it with the letter in the same position in cube A. When completed, you obtain the deciphered word.

#### Example

Encrypted word: ITLUEW
Keyword A: SINKING → key: SINKGABCDEFHJLMOPQRTUVWXYZ
Keyword B: VINE → rotations: 3×D, 1×R, 3×B, 1×F

I → E
T → X
L → T
U → R
E → A
W → S

Deciphered Word: EXTRAS

Once you finally have your deciphered 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.