A simple and fast C++ implementation of an Enigma machine, with support for 94 ASCII characters and 2 rotors. Created just for fun! 😜
To simply get Enigma up and running, download an executable from the bin/ folder, depending on your platform. Though not necessary, it's recommended that you add the executable path to $PATH(Windows/Linux).
To run Enigma, double click on the executable or launch from the commandline.
On Windows:
cd path_to_enigma_executable
enigma
On macOS or Linux:
cd path_to_enigma_executable
./enigma
If you can't execute due to a Permission denied
error, you're probably missing execution permission. To fix, simply type:
cd path_to_enigma_executable
chmod +x enigma
and try again.
After Enigma is up and running, simply type a normal or cyphered message and let Enigma (de)cypher it. Supported characters are ASCII ' ' to '}'.
The fun of the Enigma relies on its many different settings. Cyphering messages requires an enigma.set file to be present in the current working directory, which stores the settings for the 2 rotors, plugboard and reflector (more on how an enigma machine works on Wikipedia). If a settings file isn't present, Enigma automatically generates one on startup. When you want to exchange cyphered messages with others, make sure everyone is using the same enigma.set file, otherwise decyphering messages will produce rubbish.
~h ~H
: Show help menu
~r ~R
: Reload settings file
~n ~N
: Create a new settings file
~q ~Q
: Quit
This repository provides a premake configuration for Visual Studio for Windows. To generate a solution, execute the appropriate .bat file. For example, to generate a solution for Visual Studio 2019, run:
vs2019.bat
The resulting solution will be created in a folder called project/.
Alternatively, source can be compiled with any other compiler, such as g++.
g++ -std=c++17 src/main.cpp src/Enigma.cpp -O3 -o enigma
Enigma is licensed under the GNU General Public License - see LICENSE file for details.