| Crates.io | classic_crypto |
| lib.rs | classic_crypto |
| version | 0.2.0 |
| created_at | 2021-02-24 21:59:00.865364+00 |
| updated_at | 2021-05-21 19:18:04.226885+00 |
| description | Encrypt, decrypt and solve classical ciphers with any charset. |
| homepage | https://github.com/upsidedown8/classic_crypto |
| repository | https://github.com/upsidedown8/classic_crypto |
| max_upload_size | |
| id | 360135 |
| size | 9,016,212 |
There is a CLI available for this library here.
Add this line to your Cargo.toml
classic_crypto = "0.1.0"
use classic_crypto::{Asymmetric, Caesar, Keyed, Solve, lang::Language};
fn main() {
let mut language = Language::from_file("examples/data/english.bin").unwrap();
let mut caesar = Caesar::new(&mut language);
caesar.randomize(&mut language);
let plaintext = "Secret message!";
let ciphertext = caesar.encrypt(&mut language, plaintext);
caesar.randomize(&mut language);
caesar.solve(&mut language, &ciphertext);
let plaintext = caesar.decrypt(&mut language, &ciphertext);
println!("plaintext {}", plaintext);
}
| Name | Encrypt/Decrypt | Solve |
|---|---|---|
| ADFGVX | ⬜️ | ⬜️ |
| ADFGX | ⬜️ | ⬜️ |
| Affine | ✅ | ✅ |
| Atbash | ✅ | N/A |
| Autokey | ✅ | ✅ |
| Baconian | ✅ | N/A |
| Beaufort | ✅ | ✅ |
| Bellaso | ✅ | ✅ |
| Bifid | ⬜️ | ⬜️ |
| Block Transposition | ✅ | ✅ |
| Caesar | ✅ | ✅ |
| Chaocipher | ⬜️ | ⬜️ |
| Classic Vigenère | ✅ | ✅ |
| Clock | ✅ | ✅ |
| Chase | ✅ | ✅ |
| Column Transposition | ✅ | ✅ |
| Enigma M3/M4 | ✅ | ⬜️ |
| Fialka | ⬜️ | ⬜️ |
| Four Square | ⬜️ | ⬜️ |
| Fractionated Morse | ⬜️ | ⬜️ |
| Hill (2x2 and 3x3 matrices) | ⬜️ | ⬜️ |
| Homophonic Substitution | ⬜️ | ⬜️ |
| Keyed Vigenère | ✅ | ⬜️ |
| Lorenz | ⬜️ | ⬜️ |
| Morse | ✅ | N/A |
| Myszkowski Transposition | ⬜️ | ⬜️ |
| Playfair | ⬜️ | ⬜️ |
| Polybius Square | ⬜️ | ⬜️ |
| Porta | ✅ | ✅ |
| Purple | ⬜️ | ⬜️ |
| Railfence | ✅ | ✅ |
| Rot13 | ✅ | N/A |
| Scytale | ✅ | ✅ |
| Simple Substitution | ✅ | ✅ |
| Solitaire | ⬜️ | ⬜️ |
| Straddle Checkerboard | ⬜️ | ⬜️ |
| Trifid | ⬜️ | ⬜️ |
| Two Square | ⬜️ | ⬜️ |
| Typex | ⬜️ | ⬜️ |
| VIC | ⬜️ | ⬜️ |