A modern C++ recreation of the Enigma Machine, the electromechanical cipher device used by Germany during World War II.
This simulator captures the mechanics of the original machine, including the rotors, reflector, plugboard, and cascading offsets.
g++ main.cpp -o enigma && ./enigma- Configure plugboard links
- Set rotor starting positions
- Encrypt and decrypt messages
- Messages must consist of only alphabetical characters (A–Z or a–z). No spaces.
The encryption is historically faithful but slightly simplified. Double-stepping and ring settings are not implemented (by design). Reflector wiring is psuedorandomly generated but always remains an involution.
This project was inspired by the excellent video "How the Enigma Machine Works" by Numberphile, which breaks down the fascinating electromechanical design behind one of history’s most famous cipher machines: