Expand description
§Ciphers
Ciphers is a Rust library that provides implementations of many different classical ciphers.
§1. Supported Ciphers
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 |
§2. Installation
Simply put the following in your Cargo.toml.
[dependencies]
ciphers = "0.1.0"
§3. Example Usage
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);
}
§4. To be Implemented
There are currently 6 different ciphers to be implemented.
Transposition | Monoalphabetic | Polyalphabetic | Polygraphic | Other |
---|---|---|---|---|
Rot13 | Gronsfeld | Hill | Bifid | |
Trifid | ||||
Straddle Checkerboard |
Structs§
- ADFGVX
- An ADFGVX cipher implementation.
- ADFGX
- An ADFGX cipher implementation.
- Affine
- An Affine cipher implementation.
- Atbash
- An Atbash cipher implementation.
- Autokey
- An Autokey cipher implementation.
- Beaufort
- A Beaufort cipher implementation.
- Caesar
- A Caesar cipher implementation.
- Columnar
Transposition - A Columnar Transposition cipher implementation.
- Four
Square - A Four-Square cipher implementation.
- Playfair
- A Playfair cipher implementation
- Polybius
Square - A Polybius Square cipher implementation.
- Porta
- A Porta cipher implementation.
- Rail
Fence - A Rail-fence cipher implementation.
- Running
Key - A Running Key cipher implementation.
- Substitution
- A Simple Substitution cipher implementation.
- Vigenere
- A Vigenere cipher implementation.
Enums§
- Cipher
Input Error - Errors that can result when giving a cipher method bad input.
Traits§
- Cipher
- Defines the implementation for cipher functionality.
Type Aliases§
- Cipher
Result - A Result alias where the
Err
case isciphers::CipherInputError
.