Six display digits aren’t much room for an Enigma simulator, but they’re enough if the machine encrypts numbers rather than letters. Arduino Enigma shared this 6502 assembly project on Hackaday.io, adapting the numbers-only Enigma Z30 to the KIM Uno’s existing keypad and seven-segment display. Started on November 29, 2016 for the #1kBChallenge, it pursued a specific goal: make an Enigma simulator without designing a custom PCB.
The choice of cipher machine made the hardware fit. Instead of finding a way to represent a 26-letter keyboard and lamp field, the program could use keys 0–9, four digits for rotor positions, and the remaining two digits for input and output.
Six digits do more than show the answer
The simulated Z30 has three interchangeable rotors and a leftmost reflector, all with adjustable positions and ring settings. Each keypress first advances the mechanism, then sends the input through the rotor mappings, into the reflector, and back through the rotors along a different route. Resetting the same machine settings and starting positions lets an encrypted sequence pass back into its original numbers.
Arduino Enigma credits Anders Wik’s 2016 paper, “Enigma Z30 retrieved”, with providing enough information to attempt the reconstruction.
The interface makes useful work of a property of this machine: a digit never encrypts to itself. The two rightmost display digits therefore show 00 when the program is ready, without confusing that status with a valid input/output pair. Pressing a number advances the rotors and displays the entered digit beside its encrypted result.
There’s a practical compromise here. Arduino Enigma didn’t find a way to detect a continuously held key, so the result stays visible for one second—or until another keypress—instead of behaving like an original lamp that remains lit while its key is held. Eight other keys adjust the four rotor positions up and down.
The settings menu still fits below 1 kB
The first basic program occupied 460 bytes, including its substitution tables and defaults. It reused the KIM-1 monitor’s GETKEY and SCANS routines; counting those routines and their dependencies added 150 bytes, bringing the challenge total to 610 bytes. Initially, changing the underlying machine settings meant editing values in memory at address $0050.
The January 4, 2017 update brought those settings into the running program. Pressing B opened a rotor-selection screen marked F1, then a ring-setting screen marked F2. The same up/down keys used to move the rotors now edited settings. Invalid rotor combinations produced EE, while GO restored the default key.
That version used 703 bytes of program code, or 853 bytes with the keyboard and display dependencies. The achievement wasn’t just squeezing the cipher into memory: it left enough room for configuration and error feedback on a display with no words.
Rotor motion became part of the model
The March 26, 2017 release added a choice between two stepping systems after Arduino Enigma identified lever-driven and geared versions of the machine.
Lever stepping includes a double-stepping effect; with the stated ring settings, the project gives the position sequence 0088 → 0089 → 0090 → 0101 → 0102. Geared stepping instead behaves like an odometer, without skipped numbers. This distinction matters because the rotor positions change the substitution: matching the wiring alone isn’t enough to reproduce a message if the stepping sequence differs.
A July 12, 2017 optimization log reports reducing the expanded program from 714 to 679 bytes. It also describes a further seven-byte saving available by replacing jumps with conditional branches known to be taken, yielding 672 bytes. Those are program sizes, not the earlier totals that included monitor dependencies.
A second implementation gives builders something to compare
In December 2016, Arduino Enigma reported that a spreadsheet model and the KIM Uno version produced matching results, then supplied a separate Arduino sketch with a serial interface. That sketch wasn’t part of the size challenge, but offered another way to experiment with rotor order, ring settings and starting positions.
The supplied logs extend to May 23, 2019, when the creator announced a dedicated-PCB Z30 simulator project. The original 6502 project repository remains the relevant starting point for this compact implementation.
For anyone recreating it, the revealing test is a sequence that crosses a rotor-stepping boundary, not just one encrypted digit. That’s where the settings, motion model and substitution tables have to agree—and where this tiny program becomes more than a keypad demonstration.
