A library for simulating the Enigma machines.

Package Information

Version0.3.1 (2016-Oct-08)
CopyrightCopyright (C) 2016, Kazuya Takahashi
AuthorsKazuya Takahashi
Registered byKazuya Takahashi
Dependencies none


To use this package, put the following dependency into your project's dependencies section:



enigma - Enigma machine simulation library

enigma is a library for simulating the Enigma machines written in the D programming language.

This library is aims to reproduce the existent variations of machines and mechanisms, and be also able to create user-defined models. Moreover, it is intended to be implemented internally using the mathematical representation of the components, such as groups and matrices.

Note that of course such replicas are extremely vulnerable for actual ciphering use!


This simple program using enigma imitates the existent "M3" model. It will get user input and write the ciphered text to stdout.

void main()
    import std.stdio;
    import enigma;

    auto m3 = EnigmaM3(entryWheelABC, rotorIII, rotorII, rotorI, reflectorB, "AAA");
    foreach (c; readln!dstring)

Most of the known models and their components are predefined as seen above. For more information, read the documents generated with dub --build=docs.

About Enigma

Available versions

0.3.1 0.3.0 0.2.0 0.1.2 0.1.1 0.1.0 ~master