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:

  1. Guesses the rotors and first key setting.
  2. Guesses the remaining key settings and ring settings.
  3. Incrementally adds the best plug until no improvement is made.

Assumes msg contains only uppercase ASCII characters.