A Java implementation of the World War II German Enigma encryption machine simulator. This project provides a detailed simulation of the mechanical-electrical mechanisms of the original Enigma machine, including rotors, reflectors, and the stepping mechanism.
The Enigma machine was a sophisticated encryption device used by German forces during World War II. This simulator recreates the functionality of the historical Enigma machine, implementing its key features:
- Substitution cipher mechanism
- Progressive substitution for each letter
- Configurable rotor system
- Reflector mechanism
- Double-stepping feature
- Configurable number of rotors (N)
- Support for multiple rotor types
- Reflector implementation
- Moving and Fixed rotor support
- Comprehensive permutation system
- Full alphabet support
- Detailed testing suite
- Java
- JUnit (for testing)
- Make (build system)
enigma/
├── Machine.java # Main Enigma machine implementation
├── Rotor.java # Base rotor class
├── MovingRotor.java # Implementation of moving rotors
├── Permutation.java # Permutation logic
├── TestUtils.java # Testing utilities
└── Makefile # Build configuration
- Machine: The main class that simulates the Enigma machine
- Rotor: Implements the rotor mechanism with permutations
- MovingRotor: Handles the rotating mechanism of the rot ors
- Permutation: Manages the letter substitution logic
- Reflector: Implements the reflection mechanism
- Java Development Kit (JDK)
- Make
makemake checkThe simulator can be configured with different initial settings and can both encode and decode messages. The encryption is reciprocal, meaning the same settings will both encrypt and decrypt messages.
This project is licensed under the included LICENSE file.
This implementation is based on the historical Enigma machine used during World War II. The project structure and testing framework were designed to ensure historical accuracy while maintaining modern software engineering practices. Project from UC Berkeley's CS 61B Course