ENIGMA

How it was made · Generative Assets 207

Enigma — build notes

A working Enigma I in a single HTML file — no libraries, no build step. The cipher core runs the historically documented rotor tables; the body is CSS 3D and SVG. The page's one job: let you watch a letter's electrical path re-route through the machine on every keystroke, and understand why that both made the lock immense and gave Bletchley the crack.

Concept

A wartime bakelite artefact, close and tactile: three rotor drums above a lampboard and keyboard, an auto-operator already mid-message, and a live wiring diagram tracing every stroke from key through plugboard, three rotors and reflector back to a lamp. The audience is anyone who has heard "Enigma" and never seen the current move. Type, and the machine is yours.

Palette

Bakelite
#15130F
The machine's moulded case — warm near-black, never neutral grey.
Lamp glow
#E7B94C
Line/mark only: lit lamps, the traced path, the counted zero. Never body text.
Rotor brass
#8A6D33
Drum rims, kickers, machined rules — the metal under the keys.
Message pad
#E5DCC6
The paper tape and headline paper-white; its ink on paper is #3B342A.
Body ink
#D9D0B8
Derived from the paper for copy on bakelite — ~11:1 contrast, since the amber is reserved for marks.

Type

Barlow Semi Condensed carries the machine plate: a DIN-flavoured grotesque, condensed like stamped engineering lettering, set in uppercase with generous tracking for eyebrows and all-caps display for the headline. Special Elite is the typewritten layer — the message tape and the wiring tables — because every Enigma decrypt ended its life on a typewriter.

Techniques

Cipher core, honest. Rotors I, II, III (EKMFLGDQVZNTOWYHXUSPAIBRCJ, AJDKSIRUXBLHWTMCQGZNPYFVOE, BDFHJLCPRTXVZNYEIWGAKMUSQO), reflector B (YRUHQSLDPXNGOKMIEBFZCWVJAT), turnovers Q / E / V, ring settings A-A-A, six plug pairs, ground setting ADS. Stepping is odometer-with-a-defect: right drum every stroke, middle at the right's notch, middle and left when the middle sits on its own notch — the double-step, which the machine plays out on screen in its first five strokes (ADV → AEW → BFX) and which trims the stepping period from 17,576 to a measured 16,900.

Signature — the live path trace. Each keystroke returns a full trace object (key, plugboard, three forward rotor exits, reflector pair, three inverse exits, lamp). An SVG with six contact columns × 26 rows plots it as two polylines — a 7-point amber forward run ending in the reflector's vertical jog, and a 6-point paper-toned return — animated by stroke-dashoffset so the current visibly flows. Because the rotors move before the circuit closes, pressing the same key twice draws two different roads; the diagram is computed from the same trace the lamps use, so it cannot lie.

CSS 3D drums. Each rotor is a true cylinder: 26 lettered faces, each rotated 360/26 ≈ 13.85° apart and pushed out translateZ(90px) (radius from face height 22px: 11/tan(π/26) ≈ 90.3). The drum rotates by cumulative steps — ground + step count — so carries roll continuously without unwinding, and the housing clips the cylinder to a window with an amber bezel over the reading row. Turnover letters carry a machined notch-dot on their face — a second-read detail for whoever watches a full revolution.

Auto-operator. A convoy sighting report types itself at a 700 ms cadence, so the 7-second thumbnail catches the machine mid-message with the double-step already played. Your own keydown takes the keyboard over; the operator resumes after six idle seconds. A window.__enigma probe exposes the machine, its class, and a driveable press() so QA gates on state, not wall-clock.

Iteration log

Pass 1 — Craft

Pass 2 — Depth

Pass 3 — Hardening

Honest numbers

← Back to the machine  ·  Collection index