Function evp_bytestokey::evp_bytes_to_key

source ·
pub fn evp_bytes_to_key(
    _password: &str,
    _key_bits: u32,
    _iv_len: usize
) -> Result<(Vec<u8>, Vec<u8>), Box<dyn Error>>
Expand description

Generates a key and initialization vector (IV) from a password using the EVP_BytesToKey algorithm.

§Arguments

  • password - A string representing the plaintext password
  • key_bits - An unsigned 32-bit integer representing the desired key size in bits.
  • iv_len - An unsigned integer representing the desired IV length in bytes.

§Returns

A Result containing a tuple of two vectors of bytes: the derived key and initialization vector (IV).