Skip to main content

Crate cryptography_breaker

Crate cryptography_breaker 

Source
Expand description

Cryptography breaker

This crate provide way to encrypt, decrypt and break, for the moment only Vigener cipher

You can do it in almost every possible case. The crate support selecting own alphabet, alphabet with characters upper and lower cases, with whitespaces. You can decide what to do with whitespaces or character not provided in the alphabet

§Examples

§Encrypting text using vigenere cipher

use cryptography_breaker::normalizer::NormalizerBuilder;
use cryptography_breaker::algorithms::vigenere::Vigenere;
use cryptography_breaker::normalizer::CaseStrategy;
use cryptography_breaker::algorithms::vigenere::VigenereBuilder;
 
let plain_text = "Some Plain Text";
let key = "KEY";
let normalizer = NormalizerBuilder::default()
    .case(CaseStrategy::Preserve)
    .preserve_whitespaces(true)
    .build()
    .unwrap();
let vigenere = VigenereBuilder::default()
    .normalizer(normalizer)
    .build()
    .unwrap();
 
let cipher_text = vigenere.encrypt(plain_text, key).unwrap();
 
assert_eq!("Csko Tjkml Divd", cipher_text)

Modules§

algorithms
Algorithms
cli
Cli
normalizer
Normalizer
validator
Validator

Enums§

IoC
Index of coincidence