classic_crypto

Crates.ioclassic_crypto
lib.rsclassic_crypto
version0.2.0
sourcesrc
created_at2021-02-24 21:59:00.865364
updated_at2021-05-21 19:18:04.226885
descriptionEncrypt, decrypt and solve classical ciphers with any charset.
homepagehttps://github.com/upsidedown8/classic_crypto
repositoryhttps://github.com/upsidedown8/classic_crypto
max_upload_size
id360135
size9,016,212
(afterlife4809)

documentation

https://docs.rs/classic_crypto

README

classic_crypto

Build Status

A number of classical ciphers implemented in Rust, with the capability to supply a character set for any language.

CLI

There is a CLI available for this library here.

Usage

Add this line to your Cargo.toml

classic_crypto = "0.1.0"

Example

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);
}

Supported Ciphers

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 ⬜️ ⬜️
Commit count: 0

cargo fmt