Skip to content
/ Enigma Public

A simple and fast C++ implementation of an enigma machine

License

Notifications You must be signed in to change notification settings

guard3/Enigma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enigma

A simple and fast C++ implementation of an Enigma machine, with support for 94 ASCII characters and 2 rotors. Created just for fun! 😜
Usage example

Getting Started

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).

Launch

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.

Cypher messages

After Enigma is up and running, simply type a normal or cyphered message and let Enigma (de)cypher it. Supported characters are ASCII ' ' to '}'.
(De)cyphering example

Settings

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.

Special Commands

~h ~H: Show help menu
~r ~R: Reload settings file
~n ~N: Create a new settings file
~q ~Q: Quit

Example

How to compile

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

License

Enigma is licensed under the GNU General Public License - see LICENSE file for details.

About

A simple and fast C++ implementation of an enigma machine

Resources

License

Stars

Watchers

Forks

Packages

No packages published