Crates.io | enigma-cipher |
lib.rs | enigma-cipher |
version | 0.1.1 |
source | src |
created_at | 2024-10-05 05:51:58.863058 |
updated_at | 2024-10-05 05:54:22.32141 |
description | An absurdly fast and highly flexible Enigma machine simulation, encryption, and decryption library. |
homepage | |
repository | |
max_upload_size | |
id | 1397418 |
size | 23,651 |
enigma-rs
An absurdly fast and highly flexible Enigma machine simulation, encryption, and decryption library for Rust.
cargo add enigma-cipher
Example Usage:
use enigma_cipher::{EnigmaMachine, EnigmaResult, EnigmaBuilder as _};
pub fn main() -> EnigmaResult<()> {
let machine = EnigmaMachine::new()
.reflector("B")
.plugboard("BY EW FZ GI QM RV UX")
.rotors(1, 2, 3)
.ring_settings(10, 12, 14)
.ring_positions(5, 22, 3)?;
let plaintext = machine.decode("KDZVKMNTYQJPHFXI");
println!("{plaintext}");
}
cargo run --release
This crate uses a number of optimization techniques for max performance, including:
&[u8]
for rapid indexing