Function ultra::decrypt [−][src]
pub fn decrypt(msg: &str) -> (String, Enigma)
Decrypts the given string by iterating through multiple possible Enigma
configurations, returning (plaintext, Enigma)
corresponding to the most
probable decryption.
The decryption algorithm works in three steps:
- Guesses the rotors and first key setting.
- Guesses the remaining key settings and ring settings.
- Incrementally adds the best plug until no improvement is made.
Assumes msg
contains only uppercase ASCII characters.