evpkdf
Rust implementation of OpenSSL EVP_bytesToKey function.
evpkdf
derives key from the given password and salt.
Notice that this approach is too weak for modern standard now. Newer applications should choice a more modern algorithm like bcrypt, pbkdf2 or scrypt.
Basic Usage
use evpkdf;
use hex;
use Md5; // from md-5 crate
use Sha1; // from sha-1 crate
let mut output = ;
;
assert_eq!;
let mut output = ;
;
assert_eq!;
let mut output = ;
;
assert_eq!;
Compatible with crypto-js
Below sinppet generates the same result as
CryptoJS.kdf.OpenSSL.execute('password', 256 / 32, 128 / 32, 'saltsalt')
.
use evpkdf;
use hex;
use Md5; // from md-5 crate
const KEY_SIZE: usize = 256;
const IV_SIZE: usize = 128;
let mut output = ;
;
let = output.split_at;
assert_eq!;
assert_eq!;
License
MIT