## On the Subject of the ElsieFour CM

A machine that knows no bounds when it comes to ciphers.

Create a key using the keyword on screen 1 and the Boolean Expression on screen A. Make sure to remove any Zs. Rearrange the key into a 5×5 matrix.

Take the letter displayed on screen B and label it the Marked Letter.

If the Submit Button is white, follow the instructions under Encrypt Instructions. Otherwise follow the instructions under Decrypt Instructions.

#### Encrypt Instructions

• Take the Marked Letter’s alphabetic position, minus 1 (A0Y24) and modulo it by 5. This will be called R.
• Take the Marked Letter’s alphabetic position, minus 1 (A0Y24) and divide it by 5, rounding down. This will be called D.
• Find the Nth letter of the encrypted word in the Matrix and go right an R amount of times and down an D amount of times, wrapping around if needed.
• The letter you end up on becomes your Nth decrypted letter.
• Shift the row to the right that contains the Nth decrypted letter.
• Shift the column down that contains the Nth encrypted letter.
• Take the encrypted letter's alphabetic position, minus 1 (A0Y24) and modulo it by 5. This will be called R.
• Take the encrypted letter's alphabetic position, minus 1 (A0Y24) and divide it by 5, rounding down. This will be called D.
• Find the Marked Letter in the Matrix and go right an R amount of times and down an D amount of times, wrapping around if needed.
• The letter you end up on becomes your new Marked Letter.

#### Decrypt Instructions

• Take the Marked Letter’s alphabetic position, minus 1 (A0Y24) and modulo it by 5. This will be called L.
• Take the Marked Letter’s alphabetic position, minus 1 (A0Y24) and divide it by 5, rounding down. This will be called U.
• Find the Nth letter of the encrypted word in the Matrix and go left an L amount of times and up an U amount of times, wrapping around if needed.
• The letter you end up on becomes your Nth decrypted letter.
• Shift the row to the right that contains the Nth decrypted letter.
• Shift the column down that contains the Nth encrypted letter.
• Take the encrypted letter's alphabetic position, minus 1 (A0Y24) and modulo it by 5. This will be called R.
• Take the encrypted letter's alphabetic position, minus 1 (A0Y24) and divide it by 5, rounding down. This will be called D.
• Find the Marked Letter in the Matrix and go right an R amount of times and down an D amount of times, wrapping around if needed.
• The letter you end up on becomes your new Marked Letter.

Finally, if any of the letters on screen 2 match at the same position as any of the letters of your encrypted word, replace that letter with a Z. You should now have an decrypted word.

#### Example 1

Encrypted Word: QHRNI
Marked Letter: T
Screen 2: CVMEN
Using Encrypt Rules

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

T → 19 → R4 D3
Q + R4 + D3 → B

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

Q → 16 → R1 D3
T + R1 + D3 → F

F → 5 → R0 D1
H + R0 + D1 → O

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

H → 7 → R2 D1
F + R2 + D1 → B

B → 1 → R1 D0
R + R1 + D0 → A

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

R → 17 → R2 D3
B + R2 + D3 → C

C → 2 → R2 D0
N + R2 + D0 → R

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

N → 13 → R3 D2
C + R3 + D2 → B

B → 1 → R1 D0
I + R1 + D0 → D

BOARD + CVMEN → BOARD
Decrypted Word: BOARD

#### Example 2

Encrypted Word: XOYQ
Marked Letter: D
Screen 2: SLNY
Using Decrypt Rules

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

D → 3 → L3 U0
X + L3 + U0 → S

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

X → 23 → R3 D4
D + R3 + D4 → R

R → 17 → L2 U3
O + L2 + U3 → E

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

O → 14 → R4 D2
R + R4 + D3 → B

B → 1 → L1 U0
Y + L1 + U0 → R

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

Y → 24 → R4 D4
B + R4 + D4 → U

U → 20 → L0 U4
Q + L0 + U4 → O

SERO + SLNY → ZERO
Decrypted Word: ZERO

You can use the table below to get the values for moving Up/Right/Down/Left. Find the letter in the table and the column will be the horizontal movement while the row will be the vertical movement.

LR >
-----
DU
v
01234
0ABCDE
1FGHIJ
2KLMNO
3PQRST
4UVWXY