Crates.io | ultra |
lib.rs | ultra |
version | 0.6.1 |
source | src |
created_at | 2016-11-15 08:20:00.418968 |
updated_at | 2021-04-17 06:13:31.185582 |
description | Cryptanalysis of the Engima. |
homepage | https://github.com/iKevinY/ultra |
repository | https://github.com/iKevinY/ultra |
max_upload_size | |
id | 7257 |
size | 3,518,777 |
ultra
is a Rust implementation of the Enigma machine that includes the
ability to decrypt ciphertext.
ultra
can be installed from crates.io using Cargo:
$ cargo install ultra
Encrypt a message with rotors 1-4-2
, key setting D-O-G
, and ring setting C-A-T
:
$ ultra --rotor=142 --key=DOG --ring=CAT "The quick brown fox jumps over the lazy dog."
Ntz ntqlz jmwll art bbnow wzqk keq ievk lzo.
Encrypt a message using random Enigma settings:
$ ultra --randomize "The quick brown fox jumps over the lazy dog."
Kxj mcwzf oqgmz pwr vnfqq iwhv wcr qqgt lgd.
> Rotors: 5-2-3 / Key: A-A-G / Ring: N-W-Q / Plugs: CG EZ HW IJ MP TY
Attempt to decrypt a piece of ciphertext:
$ ultra --decrypt "$(cat ciphertext.txt)"
...
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.
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.
ultra
is licensed under the MIT License.