tiny-crypto
The tiny-crypto crate is a collection of tools for common crypto algorithms, with APIs aimed to be simple to use.
Table of tools
- Cryptographic Hash Functions (hash)
- Sha1
- Symmetric Ciphers (sym)
- Aes128, Aes192, Aes256
- Text Encoders (encoding)
- Base64
Example
Use sha1 hasher:
let result: = sha1!;
assert_eq!;
let hex_result: String = sha1_hex!;
assert_eq!;
Use Aes128 cipher:
use ;
let cipher = from_key_array;
let plain = b"This is the plain text";
let iv = ;
let data = cipher.encrypt_with_iv;
let out = cipher.decrypt_with_iv;
assert_eq!;
Use Base64 encoder:
use ;
let origin: & = b"some bytes to encode";
assert_eq!;
Use Hex encoder:
use ;
let origin: & = b"some bytes to encode";
assert_eq!;
License: MIT