Skip to content

Ayxan13/Enigma

Repository files navigation

C++ Enigma

This is a C++ implementation of an Enigma machine. Largely based on this project.

Here is how you use it:

#include <cstdio>

#include "Enigma.hpp"

int main()
{
	using namespace EnigmaCpp;
	using namespace RotorTypeSpecific;
	Enigma enigmaMachine(
		Rotor(RotorName::VII, 10, 1),
		Rotor(RotorName::V, 5, 2),
		Rotor(RotorName::IV, 12, 3),
		Reflector(Reflector::Name::B),
		PlugBoard("AD FT WH JO PN"));

	auto const plainText = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	auto const cipherText = enigmaMachine.Encrypt(plainText);

	std::printf("'%s' encrypted is '%s'\n",
		plainText, cipherText.c_str());
}

About

C++ implementation of an Enigma machine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published