Derive a cipher key and IV from a password using the legacy EVP_BytesToKey KDF.
Declared in <openssl/evp.h>
int
EVP_BytesToKey(
EVP_CIPHER const* type,
EVP_MD const* md,
unsigned char const* salt,
unsigned char const* data,
int datal,
int count,
unsigned char* key,
unsigned char* iv);
Length of the derived key in bytes, or 0 on error.
| Name | Description |
|---|---|
| type | Cipher whose key and IV lengths determine the output sizes. |
| md | Digest used in the iterative key derivation (commonly EVP_md5()). |
| salt | Optional 8-byte salt, or NULL. |
| data | Password / passphrase bytes. |
| datal | Length of data in bytes. |
| count | Iteration count (higher slows brute-force attacks). |
| key | Output buffer for the derived key, or NULL to skip. |
| iv | Output buffer for the derived IV, or NULL to skip. |