+
Skip to content

DSpeckhals/ultra

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ultra Build Status crates.io docs.rs License

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:

$ 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: 314, Key Setting: NHO, Ring Setting: VTB)

Decrypt the ciphertext generated in the previous example:

$ ultra --decrypt "Kxj mcwzf oqgmz pwr vnfqq iwhv wcr qqgt lgd."
The quick brown fox jumps over the lazy dog.
(Rotors: 314, Key Setting: SZO, Ring Setting: ALB)

Decryption relies on quadgram frequencies to infer the original Enigma machine settings, and as a result, it is quite likely that short messages will be decrypted incorrectly. Additionally, decryption will not work for messages that were encrypted with any plugboard plugs active. See this blog post for a brief overview of the decryption algorithm.

References

This project's quadgram data and decryption algorithm is based on James Lyons' articles about the Enigma machine.

License

ultra is licensed under the MIT License.

About

Cryptanalysis of the Enigma machine in Rust.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载