Cryptor
Cryptor is encryption machine corresponding to the diversity of algorithms.
Dependencies
Insert to Cargo.toml of your project.
[]
= "0.1.2"
or
// Newest version
❯ cargo add cryptor
// Version specification
❯ cargo add cryptor@0.1.2
// If not exist on crates.io
❯ mkdir lib
❯ cd lib
❯ git clone https://github.com/atsushi130/Cryptor
❯ cd ..
❯ cargo add cryptor --path=lib/cryptor/
Default crypto algorithm
Usage
Import modules
extern crate cryptor;
use ;
Implement structure with this Algorithm trait.
Cryptor have member with Algorithm trait. Dependency injection your implemented structure to Cryptor.
let mut cryptor = Cryptor ;
Return type of encrypt and decrypt method is CryptoValue<YourAlgorithm>
;
let encrypted: = cryptor.encrypt;
println!;
let decrypted: = cryptor.decrypt;
println!;
Encrypter have member with Algorithm trait. Dependency injection your implemented structure to Encrypter.
let mut encrypter = Encrypter ;
Return type of encrypt method is EncryptValue<YourAlgorithm>
.
let encrypted: = encrypter.encrypt;
println!;
Run
❯ cargo build
❯ cargo run
Test
❯ cargo test
LICENSE
This project is dual-licensed under MIT and Apache 2.0.