Turning an Enigma in the browser
- Objective
- A Three.js Enigma you can actually rotate — lampboard, keyboard, plugboard, rotors — plus Bomba and Turing breakers, served as a Cloudflare Worker at enigma.rclabs.in.
- Date
- · 2 min read
- Apparatus
- threejscloudflareworkersenigmashipped
- Experiment
- EXP-003 · Enigma
- Observer
- RC · Berlin
This is the story behind Enigma, the WWII cipher machine as an interactive 3D sim at enigma.rclabs.in.
I wanted to feel the machine, not watch a flat diagram of it. Type a letter, see a lamp light, watch a rotor step, flip a plug. The same settings that encipher should decipher. If that loop is wrong, the 3D chrome does not matter.
Build the machine you can turn
The sim is Three.js in the browser: a full Enigma body with a lampboard, keyboard and plugboard, plus camera shots for rotors, drums, rear plugs and internals. OrbitControls for free look. A bloom pass so the amber lamps feel like real bulbs instead of flat disks.
You can switch models — Enigma I, Enigma II, and the later paths — and set rotor order the way an operator would. Type on the keyboard (or click the keys) and the lampboard answers. The plugboard is not decoration; swapping cables changes the cipher path.
The tagline on the intro is the whole contract: Type to encipher. The same settings decipher.
Put the breakers next to it
A sim of Enigma without the attack is only half the story. The page also has Bomba and Turing views: the search machinery that made the wartime traffic readable. You can run a break search and, when a stop lands, load those settings back into Enigma I and watch the plaintext come out on the same machine that hid it.
That closing of the loop is what made the project worth shipping. Cipher and cryptanalysis on one stage, same lighting, same camera grammar.
Ship it at the edge
The app is a static SPA — HTML, CSS and Three.js vendor files — behind a thin Cloudflare Worker. The Worker serves /health and hands everything else to Workers Assets with SPA fallback. Custom domain: enigma.rclabs.in. Source: github.com/chandrasekar-r/enigma.
No backend session, no account, no telemetry of what you type. The machine runs where you are. That felt right for something people will open on a phone just to turn a rotor once.
What I learned
Fidelity beats metaphor. Early sketches had a prettier shell and a lazier cipher path. The moment the plugboard and rotor stepping were honest, the object stopped feeling like a toy.
Camera shots are documentation. Named views (lampboard, keyboard, internals) teach faster than a walls-of-text help panel. Free look is for the curious; the shots are for everyone else.
Edge static is enough. A Worker plus assets is the whole deploy. The interesting work was the machine, not the hosting.
If you have five minutes, open enigma.rclabs.in, set a rotor order, type your name, reset to the same settings and type the ciphertext back. When the lamps spell your name again, the column did its job.