On the Subject of Distance Cipher

Two metres please.

On the module, there will be two parallelogram-shaped displays, three triangular buttons arranged in a triforce formation, and another triangular button to the right of them, showing the key letter and the key digit.

To disarm this module, perform the following steps to obtain a triangular key grid, then use it to obtain your decrypted word to submit into the module using the buttons arranged in a triforce formation.

Step 0: Making the key triangle

Create a 7×7 equilateral triangle, with one of its vertices facing South. Place the first letter of the keyword in the first cell in reading order of this triangle. Then, for each subsequent letter in the keyword, if it has been used, find the closest unused letter (with wraparound, so the distance between the letters A and Z is the same as A and B, that being 1), and place it in the next unfilled cell of the triangle. Repeat this until all letters of the keyword have been used, and the top-most row of the triangle has been filled.

Then, for each subsequent cell, consider the absolute difference between the two alphabetical positions of the two cells immediately above. If the corresponding letter has not been used, place it in the next unfilled cell. Otherwise, follow the same procedure for when a used letter is encountered. Then, place the unused letter in the next unfilled cell. Repeat this until 25 out of the 26 letters in the English alphabet have been used. The remaining letter will be referred to as the “unused letter”. Place #'s in the cells in the second to last row, then the unused letter at the bottom.

If a previously used letter is encountered and the two nearest unused letters have the same distance to the used letter, take the unused letter that would be reached by going backwards in the alphabet, wrapping from A to Z.

Example triangular grid using the keyword “FOREVER”

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

Step 1: Caesarean Role-Switching Cipher

To decrypt, consider the number of steps forward in the alphabet to get from the first letter of the encrypted word to the key letter. Apply this shift to the key letter, and the obtained letter will be the first decrypted letter. Then, apply the same process with the next encrypted letter, and the latest decrypted letter, as the “first letter” and “key letter” respectively, until all encrypted letters have been exhausted.

Step 2: Rotational Monoalphabetic Substitution Cipher

Make a copy of the key triangle, and rotate it 120° in the direction found below

  • If the key digit and the alphabetic position of the original key letter share parity, rotate it clockwise
  • If the key digit and the alphabetic position of the original key letter does not share parity, rotate it counter-clockwise

Find the encrypted letter in the original key triangle, and find the same position in the rotated key triangle. If a # is reached, temporarily rotate the new triangle 120° in the same direction, and find the position of the encrypted letter in the original triangle, and find the same position in the temporarily rotated key triangle. The result will be your decrypted letter.

The resulting position will be your decrypted letter.

Step 3: Inputting the answer

Clicking a button will reveal three sub-buttons within the button. Until two layers of buttons have been revealed, the buttons will not input letters.

The diagram to the right shows the positions of letters on the module, with “<” being the delete key. Upon striking or deleting all inputted characters, the module will go back to displaying the encrypted word and the keyword.