Crates.io | ciphers |
lib.rs | ciphers |
version | 0.1.0 |
source | src |
created_at | 2019-08-25 08:37:29.656609 |
updated_at | 2019-08-25 08:37:29.656609 |
description | Cipher implementation library. |
homepage | |
repository | https://github.com/sradley/ciphers |
max_upload_size | |
id | 159513 |
size | 119,194 |
Ciphers is a Rust library that provides implementations of many different classical ciphers.
Get started by looking at the documentation.
There are currently 16 different supported ciphers.
Transposition | Monoalphabetic | Polyalphabetic | Polygraphic | Other |
---|---|---|---|---|
Rail-fence | Simple Substitution | Vigenere | Playfair | ADFGX |
Columnar Transposition | Caesar | Beaufort | Four-Square | ADFGVX |
Affine | Autokey | |||
Polybius Square | Running Key | |||
Atbash | Porta |
Simply put the following in your Cargo.toml.
[dependencies]
ciphers = "0.1.0"
E.g. using the Vigenere cipher.
use ciphers::{Cipher, Vigenere};
fn main() {
let vigenere = Vigenere::new("examplekey");
// encipher
let ctext = vigenere.encipher("someexampletexthere").unwrap();
println!("ciphertext: {}", ctext);
// decipher
let ptext = vigenere.decipher(&ctext).unwrap();
println!("plaintext: {}", ptext);
}
ciphertext: WLMQTIEWTJIQEJISIBI
plaintext: SOMEEXAMPLETEXTHERE
There are currently 6 different ciphers to be implemented.
Transposition | Monoalphabetic | Polyalphabetic | Polygraphic | Other |
---|---|---|---|---|
Rot13 | Gronsfeld | Hill | Bifid | |
Trifid | ||||
Straddle Checkerboard |