> CYLINDER CIPHER
The idea in plain English: Imagine wrapping a strip of paper around a soup can, writing a message diagonally across the paper, then unwrapping it. The letters are now scrambled in a spiral pattern. To decode, you need to know the cylinder's circumference (how many letters fit around it) and read the text diagonally. This is a transposition cipher — the letters stay the same, but their order is rearranged.
Why this really exists: The Jefferson Wheel Cipher was invented by Thomas Jefferson in 1795 — 36 wooden disks on a spindle, each with a random alphabet around its edge. You spun the disks to align a message, then read any other row as the ciphertext. The US Army used a similar device (M-94) from 1922 to 1945. The Bazeries cylinder was a simpler version used for diplomatic correspondence. The principle of rotating disks to rearrange letters is the grandfather of modern rotor machines like Enigma.
▸ Concrete Example
Message written around a cylinder with circumference 5:
The message is written diagonally (wrapping around):
H . . . . ← row 1
. E . . . ← row 2
. . L . . ← row 3
. . . L . ← row 4
. . . . O ← row 5
W . . . . ← row 6
. O . . . ← row 7
. . R . . ← row 8
. . . L . ← row 9
. . . . D ← row 10
Read left-to-right top-to-bottom: "H... E... L... L... O... W... O... R... L... D"
→ "HELLO WORLD" (reconstructed by reading at the correct diagonal slope)
▸ How to Decode (Step by Step)
1. Get the cylinder circumference and the ciphertext from the puzzle
2. Calculate how many rows the text wraps into: rows = ceil(len / circumference)
3. Fill a grid column-by-column (or row-by-row, depending on encoding)
4. Read diagonally at the given slope
5. Join characters → the answer word
rows = (len(text) + circ - 1) // circ
grid = [['']*circ for _ in range(rows)]
# Fill ... (depends on encoding direction)
# Read diagonally
result = []
for row in range(rows):
col = (row * slope) % circ
result.append(grid[row][col])
return ''.join(result)
▸ Real-World Applications
- Jefferson wheel (1795): Thomas Jefferson invented the first cylinder cipher device
- US Army M-94: Used from 1922-1945 for field communications
- Bazeries cipher: French diplomat used a simpler version for diplomatic messages
- Modern descendants: Rotor machines like Enigma evolved from the cylinder principle