A Rust toolkit for classical cryptanalysis and a few modern cryptographic attacks.
src/lib/– thebroken_rslibraryciphers/– implementations and breakers for Caesar, affine, Vigenère (IoC and n-gram based), autokey, simple/homophonic substitution and XOR ciphersstatistics/– fitness measures: chi-squared, index of coincidence, n-gram and word scoringtests/– periodicity tests: Kasiski, Friedman and twistdistinguishers/– AES-128 4-round distinguishercollision_finder.rs– multithreaded search for hash values satisfying a predicatealphabet.rs,utils.rs– shared helpers
src/bin/– command-line tools built on the libraryexamples/– hash collision search examples (collision1–collision4)ngrams/– n-gram frequency tables for several languages (English, Danish, Finnish, French, German, Icelandic, Italian, Polish, Russian, Spanish, Swedish)words/– word frequency lists (English, Swedish)
| Name | Purpose |
|---|---|
break_caesar |
Break a Caesar cipher |
break_affine |
Break an affine cipher |
break_vigenere |
Break a Vigenère cipher |
break_vigenere_ngrams |
Break a Vigenère cipher using n-gram scoring |
break_autokey |
Break an autokey cipher |
break_simple_substitution |
Break a simple substitution cipher |
aes_4_rounds |
Run the AES 4-round distinguisher |
ngrams_score |
Score text against n-gram statistics |
kasiski, friedman, twist |
Estimate the key length of polyalphabetic ciphers |
cargo build --release
cargo run --release --bin break_vigenere -- --help
cargo run --release --example collision1