Home - thepinkmile/Enigma-NG GitHub Wiki

Enigma NG: Digital Cryptography Ecosystem

The Enigma-NG is an advanced "Museum-Grade", modular, and historically-accurate digital recreation of the world’s most iconic encryption machines. Powered by a Raspberry Pi Compute Module 5 (CM5), this system controls a hardware stack of up to 30 custom CPLD-based rotors and a physical 64-jack plugboard. Powered with either USB-C Power Adapter, PoE+ or Smart Battery. It bridges 1940s mechanical heritage with 2026 high-speed digital engineering.

πŸš€ Project Vision

To create a high-fidelity, educational, and industrially robust encryption platform. The design prioritises classroom safety, professional EMI shielding, and deep hardware visibility for students via an integrated diagnostic bank. Beyond a simple Enigma clone, this terminal is a Universal Cipher Engine. The hardware is designed to emulate:

  • Enigma Variants: I, M3, M4, and Abwehr.
  • Typex: The 5-rotor British adaptation with simulated printer output.
  • SIGABA: The 15-rotor US system using complex 3-bank stepping algorithms.
  • NG-26 The modern digital enigma machine designed and created by Matthew McAtamney-Greenwood.

One of the long-term goals of this project is to introduce the ability to deliver Enigma encrypted data over the network, and even provide the ability to deliver encrypted files using a base-64 encoding before executing the standard rotor-based encryption. This end-goal will involve the definition of a new RFC for the "Enigma-Packet-Protocol (EnPP)", which will be a custom specification for this project's ecosystem.

Tools Used

  • Visual Studio Code: To manage the Documentation within this repository.
  • Visual Studio: (Latest Community Edition) To develop the GUI Application.
  • KiCAD 9: To develop the electrical components and PCB layouts.
  • OnShape: To create and manage the mechanical designs and assemblies.
  • Yocto: To create the custom Linux OS with built-in drivers and GUI Application.

Core Component Overview

  • Controller Board: Raspberry Pi Compute Module 5 (CM5) carrier board hosting the fixed motherboard, external I/O, and service docks.
  • Power Module: Removable power-conditioning / UPS cartridge with PoE, USB-C, smart-battery inputs, eFuse protection, and supercap-backed hold-up.
  • Stator Board: Removable vertical daughterboard and CPLD routing hub for the rotor stack, encoder ports, reflector return, and Settings Board I2C link.
  • Rotor Module: Repeated smart encryption unit (up to 30 fitted) with local CPLD and position sensing.
  • Extension Board: 5-rotor group bridge used to regenerate JTAG timing and carry power / return-path continuity between rotor groups.
  • Reflector Board: Mandatory passive turnaround board at the end of the rotor chain.
  • Encoder Module: Single generic 64-line interface board reused in keyboard, lightboard, and plugboard encode / decode roles.
  • Settings Board: Panel-mount switch and RGB indicator board on the shared Stator I2C-1 bus.
  • JTAG Daughterboard: Internal FT232H-based USB-to-JTAG bridge for programming all system CPLDs.

Core Requirements

  • Interface: Controller ↔ Power Module uses three TE 10-position 2.5mm dock connectors; Controller ↔ Stator uses two Molex EXTreme Guardian HD hybrid docks.
  • Diagnostics: Two ENIG diagnostic banks are provided on the Controller for the PM and Stator dock interfaces.
  • UI: .NET 10.0 Cross-platform GUI with:
    • Live power telemetry.
    • Historical resources.
    • 3D graphical visualiser.
    • Configuration programmer (and creator).

Board Status Snapshot

Board Status
Controller Board In Review
Power Module In Review
Stator Board In Review
Rotor Module In Review
Extension Board In Review
Reflector Board In Review
Encoder Module In Review
Settings Board In Review
JTAG Daughterboard In Review

πŸ”Œ Hardware Architecture

1. Power Module (The Heart)

  • Input: Triple-input OR-ing between PoE+ 802.3bt Type 4, USB-C 15V PD, and Battery 11–16.4V via LM74700-Q1 + CSD17483F4T ideal-diode FETs. PoE is explicitly prioritised over USB-C; USB-C vs Battery precedence follows the active input voltages unless extra gating is added.
  • PoE: Fully discrete 802.3bt Type 4 front end β€” TPS2372-4 (PD interface) + TPS23730 (ACF DC-DC) + Coilcraft POE600F-12LD transformer stage. Implemented 12V power stage capacity: 60W.
  • Protection: TPS25980 eFuse β€” 7A ILIM, 11.0V UVLO, 16.9V OVLO, 3mΞ© RON. Plus 72Β°C TCO thermal fuse.
  • Buck: Dual-phase interleaved LMQ61460-Q1 (Γ—2, 6A each, 12A combined, 400kHz DRSS, 180Β° SYNC). Effective ripple: 800kHz.
  • LDO: TPS75733KTTRG3 3V3_ENIG (8.8Β΅VRMS noise, 72dB PSRR, 3A, 2.05 A typical load at 68.3% utilisation).
  • UPS: LTC3350 supercap manager + 8Γ— Abracon ADCR-T02R7SA256MB (2S4P, 50 F) on 5V_MAIN bus. 50 F at 5.4V β†’ β‰₯33.5 second hold-up for clean CM5 shutdown.
  • Output Rails: 5V_MAIN (12A) and 3V3_ENIG (3A β€” logic, CPLDs, and rotor stack) via 80-pin Samtec ERF8 BtB to Controller Board for distribution.
  • Panel Controls: SW1 is a rugged latching RGB power toggle (Adafruit 4660) and SW2 is a matching 16mm momentary RGB CM5 power button (Adafruit 3350); both are panel-mounted controls wired to the Power Module harness.

2. Controller Board (The Brain)

  • Module: Raspberry Pi CM5 (BCM2712) on a custom 6-layer 2oz carrier.
  • Power Input: 3-way seamless switching (LM74700-Q1 ideal-diode on Power Module).
    • Smart Battery: 5-pin Molex Micro-Fit connector (11V-16.4V nominal) with SMBus telemetry + BATT_PRES_N.
    • PoE+ (802.3bt Type 4): Power-over-Ethernet delivered through the Power Module discrete TPS2372-4 + TPS23730 + POE600F-12LD path. The implemented 12V stage is sized at 60W. Single Ethernet cable carries both data and power.
    • USB-C PD: 15V USB-C PD negotiated input.
  • Protection: Over-voltage and over-current protection provided by Power Module eFuse upstream; local reverse-polarity and ESD protection on BtB interface.
  • Rotor Rail: The rotor stack is powered by the 3V3_ENIG rail (TPS75733KTTRG3 LDO, 3A) generated on the Power Module; routed to rotor stack via Controller Board β†’ Link-Beta. CM5 GPIO 16 (ROTOR_EN) gates the LDO enable for sequenced power-up.
  • JTAG Master: Embedded FT232H (Permanent USB Blaster) on internal USB 2.0.
  • Connectivity: Native USB 3.0 (SMT), HDMI (SMT), and Gigabit Ethernet.

3. JTAG Daughterboard

  • Logic: FT232H USB-to-JTAG bridge with buffered TCK / TMS drive.
  • Role: Programs the full 37-device JTAG chain (1 Stator + 6 Encoder + 30 Rotor CPLDs).
  • Mounting: Small internal hat-style daughterboard on the Controller; no external connectors.

4. Stator Board (Nervous System)

  • Role: Removable vertical daughterboard and electrical backbone of the rotor stack.
  • Routing Hub: Stator CPLD is the ENC_DATA routing matrix, reflector-map application point, and first device in the system JTAG chain.
  • Interconnects: Hosts the Controller hybrid docks, rotor sockets, reflector / extension return connector, six Encoder-module IDC ports, and the Settings Board I2C harness.
  • Peripherals: Owns the rotor-stack INA219 current monitor, three MCP23017 expanders, and the PCA9685 servo PWM driver.

5. Encoder Module (Universal Interface)

  • Generic PCB: One single-sided board reused in six roles: KBD_ENC, LBD_DEC, PLG_PASS1_DEC, PLG_PASS1_ENC, PLG_PASS2_DEC, and PLG_PASS2_ENC.
  • Logic: Intel MAX II EPM240T100I5N CPLD per board.
  • HID Path: Physical keyboard layout is 40 positions ([a-z0-9+=] plus left / right Shift), while the logical repertoire remains the full 64-character code space.
  • Plugboard Path: Two decode / encode board pairs provide the two configurable passive plugboard passes.

6. Settings Board (Configuration Panel)

  • Role: User-accessible configuration board with 12 panel-mount toggles, 12 RGB LEDs, and a CFG_APPLY pushbutton.
  • Interface: Shared Stator I2C-1 bus over a 6-wire harness (3V3_ENIG, 5V_MAIN, GND, SDA, SCL, GND).
  • Expanders: MCP23017 devices at 0x23, 0x24, and 0x25.

7. Rotor Module (The Engine)

  • Logic: Intel MAX II EPM570T100I5N CPLD.
  • Dimensions: Ø92 mm PCB / Ø100 mm shroud outer.
  • Segments: 64 characters with 8mm arc width for high readability.
  • Memory: 10 pre-loaded bidirectional wiring sets; 4-position DIP switch for "Rotor Identity" selection.
  • Sensing: FDC2114RGHR capacitive encoder ICs (dual-track, 3+3 per rotor).
  • Tri-Connector Bus:
    • Power (2x2), JTAG (2x4 Shielded), and Enigma (2x6 Bidirectional Relay) in a "Tripod" layout.
  • Signal Integrity: SN74LVC2G125DCUR buffer on each Extension Board (one per 5-rotor group) for TCK/TMS regeneration.

8. Extension Board

  • Role: Mid-stack bridge inserted between 5-rotor groups in extended builds.
  • JTAG Support: Re-buffers TCK and TMS with SN74LVC2G125DCUR to restore timing margin for the downstream rotor group.
  • Power / Return Path: Receives 3V3_ENIG and GND through the Extension Port, passes ENC_IN[0:5], ENC_OUT[0:5], SYS_RESET_N, and TTD_RETURN, and avoids a parallel power path through the rotor BtB power connector.
  • Scale: Up to five Extension Boards may be fitted in the full 30-rotor architecture.

9. Reflector Board

  • Role: Passive end-of-stack turnaround board for the final rotor group.
  • Mapping Ownership: No local CPLD; the Stator CPLD remains responsible for reflector-map selection and application.
  • JTAG Return: Terminates the JTAG daisy-chain and returns TTD_RETURN to the Stator through the 16-pin reflector ribbon.
  • Signal Path: Returns the 6-bit ENC path back toward the Stator over a separate electrical path while keeping the board itself logically passive.

πŸ’» Software Implementation

1. Linux Kernel Driver

  • Interrupt Handling: High-priority monitoring of the KEY_EVENT_INT line.
  • State Mapping: Maps 6-bit Input/Return Path to /dev/enigma_state.
  • Power Telemetry: Exposes SMBus battery data and PoE status to userspace.
  • JTAG Control: Executes Boundary Scan (SAMPLE/PRELOAD) upon keypress trigger.

2. .NET 10 GUI (The Terminal)

  • Binary File Transfer: Encrypts files via Base64 encoding/decryption through the hardware rotors.
  • Ethernet/UDP Interface: Secure 6-bit encrypted UDP streams for remote terminal communication.
  • Power Dashboard: Real-time monitoring of Battery (SoC/Temp), PoE+, and USB-C sources.
  • Rotor Library Manager: Visual tool to design custom wiring and flash the 30-rotor stack.
  • Historical Archive: Educational database of Enigma, Typex, and SIGABA variants.

3. VHDL Firmware (The Navigators)

  • Stator CPLD: Owns the ENC routing matrix, plugboard insertion positions, reflector-map application, and source-selection handoff between keyboard and CM5 virtual input.
  • Rotor CPLDs: Implement the rotor wiring libraries and per-rotor identity selection.
  • Encoder CPLDs: Provide the encode / decode logic used by the keyboard, lightboard, and both plugboard passes.
  • Status: Board-level hardware architecture is defined in the active design specs; implementation planning and pseudo-code remain tracked as open work in design/Design_Log.md.

⚠️ Safety & Design Rules (KiCAD 9)

  • eFuse Latch-off: Electronic fault protection requires manual power cycle to reset.
  • Soft Start: SW1 drives the TPS25980 eFuse EN pin; the CM5 separately gates the 3V3_ENIG LDO with ROTOR_EN.
  • ESD Hardening: TVS diodes on all exposed pins (JTAG, Enigma, and 64-jack lines).
  • Stackup: Mixed stackup architecture: Controller Board and Power Module are 6-layer boards; the remaining electronics boards are 4-layer / 2oz designs.

πŸ“… Development Roadmap

  1. Battery connector review: confirm whether alternative battery-connector options should replace or supplement the present Power Module choice.
  2. Encoder board updates: finish the current Encoder review / update pass and confirm whether any structural split work is still required.
  3. Extension follow-up: review mechanical usage and whether notch-rotation pass-through needs extra circuitry.
  4. Coupon / PAS planning: add and review board-level coupons and acceptance-test hooks across the design set.
  5. Deep review rerun: rerun the review passes after the next material design-document change set.

Contributions

This is an open-source development project. Contributions are welcomed from all. When submitting an issue please ensure you provide the SHA commit hash for the version of code that exhibits your issue and provide full replication steps. For any contributions, please create a Pull Request and ensure useful commit messages are provided. Once a PR is accepted the changes with be squashed into the current working branch of this repository and your name will be added to the list of contributors.

thepinkmile
The Pink Mile Developer

Licensing

For enquiries regarding educational licensing, please contact the maintainer. This repository is licensed under the GNU GENERAL PUBLIC LICENSE v3.

⚠️ **GitHub.com Fallback** ⚠️