On the Subject of Red Huffman Ciphers
The least efficient cipher was never practical in the first place.
This module contains 3 screens, a keyboard, 2 arrows, and a submit button that displays the current page you’re on, in the format of “#/Y”, where Y is the total amount of pages.
Pressing the left or right arrow takes the defuser to the previous or next page, wrapping around the last page. The number of pages is dependent on how long the binary string was used to generate the word. On average, there are 2 pages.
To disarm the module, decrypt a word using the following steps. Once you have the decrypted word, type it in using the keyboard. When you start typing, the screens go blank and the bottom screen will show what you are typing.
To clear your input, click one of the arrows.
Once you are satisfied with your input, press the button labeled “SUB” to submit your answer.
An incorrect submission will cause a strike but NOT reset the module.
Step 1: Binary Retrieval
Chr | Bin | Chr | Bin | Chr | Bin | Chr | Bin | Chr | Bin | Chr | Bin | Chr | Bin | Chr | Bin |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | 0000 | B | 0001 | C | 0010 | D | 0011 | E | 0100 | F | 0101 | G | 0110 | H | 0111 |
I | 1000 | J | 1001 | K | 1010 | L | 1011 | M | 1100 | N | 1101 | O | 1110 | P | 1111 |
Q | 00 | R | 01 | S | 10 | T | 11 | U | 0 | V | 1 |
Each page consists of up to 18 characters that were used to encode the original message. Create one long character string from the pages in reading order. Convert these characters displayed into their binary counterparts, to create one long binary string as a result. You will need this for the next two steps.
Step 2: Constructing The Huffman Tree
Using the binary string obtained, perform the following procedure until obtaining 26 leafing nodes, where a leafing node is a node at the end of the tree. Digits must be read once from left to right, and never trace back.
- Start with the following leafing nodes “0” and “1”.
- Read binary digits, in a sequence, until encountering a node that ONLY starts with that binary sequence.
- Split the only entry into two parts, with both entries starting with the binary sequence and ending with “0” and “1” respectively. Maintain the order of the leafing nodes when splitting.
- Repeat the previous 2 steps.