A mathematical investigation and simulation of the World War II Enigma cipher machine, implemented in SageMath using permutation-based cipher logic.
The Enigma machine was a rotor-based electromechanical cipher device used by Nazi Germany during WWII. This project investigates its mathematical underpinnings and implements a working 3-rotor simulation from scratch.
- Full 3-rotor Enigma machine simulation using permutation group theory
- Rotor wiring, stepping mechanism, and reflector logic
- Plugboard (Steckerbrett) configuration
- Encryption and decryption demonstration
- SageMath — permutation groups and mathematical cipher logic
- Jupyter Notebook — documentation and walkthrough
- GitHub — version control
| File | Description |
|---|---|
Enigma.sws |
Original SageMath worksheet (run in SageMath environment) |
Enigma.ipynb |
Jupyter notebook version for viewing on GitHub |
The .sws file requires a SageMath environment to execute. The .ipynb file can be viewed directly on GitHub and contains the full mathematical explanation alongside the code.
- Permutation-based substitution ciphers
- Rotor stepping and double-stepping mechanism
- Symmetric encryption via reflector design
- Historical cryptanalysis context
Completed as part of the Master of Data Science programme at La Trobe University (April – May 2025).