enigma-cracker 0.1.0

A start-from-nothing Enigma cipher decryption library for Rust.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 15.53 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.11 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vi013t

enigma-cracker

A start-from-nothing Enigma cipher decryption library for Rust.

enigma-cracker finds the most likely rotor settings, ring settings, and plugboard by brute forcing them one at a time and performing various cryptographic analysis techniques on the results.

Naturally, the crate can't perfectly identify the "correct" plaintext, so it relies on statistics like index of coincidence; Thus, it'll be more accurate with longer ciphertexts.

Usage

cargo add enigma-cracker
use enigma_cracker::crack_enigma;

fn main() -> EnigmaResult<()> {

	let ciphertext = include_str!("cipher_file.txt");
	let plaintext = crack_enigma(ciphertext);

	Ok(())
}
cargo run --release

Performance

The performance of this crate varies wildly by ciphertext length; Since Enigma machines decrypt character by character, the decryption process is O(n). This crate needs to perform several million decryptions, so longer ciphertexts can drastically increase runtime.

Make sure you run in release mode; The difference between debug and release mode can be over 10x in speed.

I also recommend using cargo-wizard to optimize your release profile for maximum runtime performance.