ultra
ultra
is a Rust implementation of the Enigma machine that includes the
ability to decrypt ciphertext.
Installation
ultra
can be installed from crates.io using Cargo:
$ cargo install ultra
Usage
Encrypt a message with rotors 1-4-2
, key setting D-O-G
, and ring setting C-A-T
:
Encrypt a message using random Enigma settings:
> Rotors:
Attempt to decrypt a piece of ciphertext:
Decryption relies on a combination of index of coincidence, bigram, and quadgram frequencies to infer the original Enigma machine settings, and as a result, it is quite likely that messages shorter than 500 characters will not come anywhere close to being decrypted correctly.
References
The original version of this project was based on James Lyons' articles about the Enigma machine (see this blog post for a brief overview). As of version 0.6.0, the decryption algorithm was updated, inspired by this Computerphile video.
License
ultra
is licensed under the MIT License.