A00000
B00001
C00010
D00011
E00100
F00101
G00110
H00111
I01000
J01001
K01010
L01011
M01100
N01101
O01110
P01111
Q10000
R10001
S10010
T10011
U1010
V1011
W1100
X1101
Y1110
Z1111

On the Subject of Visualizing Blue Huffman Cipher

I mean, Hogwarts is a cipher compression ciphers are a thing now.

This module contains 3 screens, a keyboard, 2 arrows, and a submit button that displays the current page you’re on.

Refer to the original manual on instructions on how to disarm this module. This module will ONLY go over some of the advanced construction of building a Huffman Tree.

For all intents and purposes, ALL examples used in this manual will refer to these initial values for each of the 26 letters.

A13B12C9D11
E18F11G15H18
I25J13K22L26
M18N16O8P24
Q24R17S25T19
U4V13W10X19
Y10Z16

The binary table on the right is ONLY used for step 3.

Contents In This Manual

Maroon Method

Bracket Method

Huffman Tree Advanced Construction: Maroon Method

When Sean made this cipher, he was alright with him making a table for the last one. Turns out that table can be manipulated for another cipher.

The Maroon method utilizes depreciated Step 3 of Maroon Cipher’s construction of building a Huffman Tree, except with a major difference. Instead of starting at 0 to decrypt for the letter, you start on the last number created by those steps. Note that numbered entries are NOT allowed to be deleted as they will be used when reading out the table.

  1. Starting at the initial list, find the 2 letters that are assigned with the lowest values (after tie breaks.)
  2. Create an entry formatted as "#: X1, X2", with # starting at 0, where X1 is the letter corresponding to the lowest value (after tie breaks) and X2 is the second lowest, and place the combined score of the 2 letters/entries to the right. (E.G. If the 2 lowest scores were 4 and 8, the combined score for this entry would be 12.) This is treated as a numbered entry.
  3. Remove the lettered entries used in creating the entry.
  4. Find the next 2 entries that have the lowest scores, and are NOT used, while also accounting for tie breaks.
  5. Create an entry formatted as "#: X1, X2", with # being the number of numbered entries created before this step, where X1 is the letter corresponding to the lowest value (after tie breaks) and X2 is the second lowest, and place the combined score of the 2 letters/entries to the right. (E.G. If the 2 lowest scores were 4 and 8, the combined score for this entry would be 12.) This is treated as a numbered entry. Note that X can be used to reference a previous entry.
  6. Repeat step 3, HOWEVER if a numbered entry is used to create the entry created on step 5, mark it as used.
  7. Repeat the previous 3 steps until only 1 unused numbered entry is left.
  8. Assign the only numbered unused entry the start of the tree.

Huffman Tree Advanced Construction: Maroon Method, Example

The lowest score is marked in black (white in dark mode), and the second lowest in gray. The first 5 iterations are shown in this case.

START

A13N16
B12O8
C9P24
D11Q24
E18R17
F11S25
G15T19
H18U4
I25V13
J13W10
K22X19
L26Y10
M18Z16

N = 0

A13N16
B12P24
C9Q24
D11R17
E18S25
F11T19
G15V13
H18W10
I25X19
J13Y10
K22Z16
L260: U, O12
M18

N = 1

A13P24
B12Q24
D11R17
E18S25
F11T19
G15V13
H18X19
I25Y10
J130: U, O12
K221: C, W19
L26
M18
N16

N = 2

A13P24
B12Q24
E18R17
F11S25
G15T19
H18V13
I25X19
J130: U, O12
K221: C, W19
L262: Y, D21
M18
N16

N = 3

A13R17
E18S25
G15T19
H18V13
I25X19
J130: U, O12
K221: C, W19
L262: Y, D21
M183: F, B23
N16
P24
Q24

N = 4

E18S25
G15T19
H18V13
I25X19
J130: U, OXX
K221: C, W19
L262: Y, D21
M183: F, B23
N164: 0, A25
P24
Q24
R17

Reading the Binary: Maroon Method

To read from the created table:

  1. Start from the only numbered unused entry, and with the current binary digit being the first digit in the obtained binary.
  2. Within that entry, if the current binary digit is a 0, look at the value to the left of the pair. Otherwise look at the value to the right of the pair.
  3. If the value is a number, go to the entry corresponding to that number. Otherwise, write down this letter as one letter in the decrypted word and move back to the beginning. Go to the next binary digit.
  4. Repeat the previous 2 steps until all binary digits are used.

Reading the Binary: Maroon Method (Example)

0U, O13Q, I
1C, W14S, 4
2Y, D15L, 5
3F, B166, 7
40, A178, 9
5J, V1810, 11
6G, N1912, 13
7Z, R2014, 15
8E, H2116, 17
9M, T2218, 19
10X, 12320, 21
112, K2422, 23
123, P

Example binary obtained: 0101 100100 1010 1000 11100

  • 0101: 24 (L)-> 22 (R)-> 19 (L)->12 (R)-> P
  • 100100: 24 (R)-> 23 (L)-> 20 (L)->14 (R)-> 4 (L)-> 0 (L)-> U
  • 1010: 24 (R)-> 23 (L)-> 20 (R)->15 (L)-> L
  • 1000: 24 (R)-> 23 (L)-> 20 (L)->14 (L)-> S
  • 11100: 24 (R)-> 23 (R)-> 21 (R)->17 (L)-> 8 (L)-> E

Huffman Tree Advanced Construction: Bracket Method

The Bracket method utilizes brackets for grouping while building a Huffman Tree. Some text edit applications can detect an enclosed bracket when using this method.

  1. Starting at the initial list, find the 2 letters that are assigned with the lowest values (after tie breaks.)
  2. Create an entry formatted as "[X1]X2", where X1 is the entry corresponding to the lowest value (after tie breaks) and X2 is the second lowest, and place the combined score of the 2 letters/entries to the right. (E.G. If the 2 lowest scores were 4 and 8, the combined score for this entry would be 12.)
  3. Remove the entries used in creating the new entry.
  4. Find the next 2 entries that have the lowest scores, while also accounting for tie breaks.
  5. Repeat the previous 3 steps until only 1 unused numbered entry is left.
  6. If necessary, space out the exterior groups.

Huffman Tree Advanced Construction: Bracket Method, Example

The lowest score is marked in black (white in dark mode), and the second lowest in gray. The first 5 iterations are shown in this case.

START

A13N16
B12O8
C9P24
D11Q24
E18R17
F11S25
G15T19
H18U4
I25V13
J13W10
K22X19
L26Y10
M18Z16

N = 0

A13N16
B12P24
C9Q24
D11R17
E18S25
F11T19
G15V13
H18W10
I25X19
J13Y10
K22Z16
L26[U]O12
M18

N = 1

A13P24
B12Q24
D11R17
E18S25
F11T19
G15V13
H18X19
I25Y10
J13[U]O12
K22[C]W19
L26
M18
N16

N = 2

A13P24
B12Q24
E18R17
F11S25
G15T19
H18V13
I25X19
J13[U]O12
K22[C]W19
L26[Y]D21
M18
N16

N = 3

A13R17
E18S25
G15T19
H18V13
I25X19
J13[U]O12
K22[C]W19
L26[Y]D21
M18[F]B23
N16
P24
Q24

N = 4

E18S25
G15T19
H18V13
I25X19
J13[C]W19
K22[Y]D21
L26[F]B23
M18[[U]O]A25
N16
P24
Q24
R17

Reading the Binary: Bracket Method

  1. Start from the first outer-most bracket. This is mainly the first character in the condensed bracket tree.
  2. Within that entry, if the current binary digit is a 0, enter within that group of bracket. Otherwise, skip that bracket. Go to the next digit and repeat this step until all binary digits are used.
    • If at any point, you reach a letter while navigating the brackets, write that letter down as one letter in the decoded string, and go back to the first outer-most bracket.

Reading the Binary: Bracket Method (Example)

Condensed:

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

Uncondensed:

[[[[X][C]W][[Y]D]K][[[F]B]P][Q]I]

[[[S][[U]O]A][L][J]V]

[[[G]N][Z]R]

[[E]H]

[M]

T

Example binary obtained: 11111 11101 11011 100101 00011 11001

  • [[[[X][C]W][[Y]D]K][[[F]B]P][Q]I] (1) -> [[[S][[U]O]A][L][J]V] (1) -> [[[G]N][Z]R] (1) -> [[E]H] (1) -> [M] (1) -> T
  • [[[[X][C]W][[Y]D]K][[[F]B]P][Q]I] (1) -> [[[S][[U]O]A][L][J]V] (1) -> [[[G]N][Z]R] (1) -> [[E]H] (0) -> [E] (1) -> H
  • [[[[X][C]W][[Y]D]K][[[F]B]P][Q]I] (1) -> [[[S][[U]O]A][L][J]V] (1) -> [[[G]N][Z]R] (0) -> [[G]N] (1) -> [Z] (1) -> R
  • [[[[X][C]W][[Y]D]K][[[F]B]P][Q]I] (1) -> [[[S][[U]O]A][L][J]V] (0) -> [[S][[U]O]A] (0) -> [S] (1) -> [[U]O] (0) -> [U] (1) -> O
  • [[[[X][C]W][[Y]D]K][[[F]B]P][Q]I] (0) -> [[[X][C]W][[Y]D]K] (0) -> [[X][C]W] (0) -> [X] (1) -> [C] (1) -> W
  • [[[[X][C]W][[Y]D]K][[[F]B]P][Q]I] (1) -> [[[S][[U]O]A][L][J]V] (1) -> [[[G]N][Z]R] (0) -> [[G]N] (0) -> [G] (1) -> N