[#PKCS5_PBKDF2_HMAC] = PKCS5_PBKDF2_HMAC :mrdocs: Derive a key from a password with PBKDF2‐HMAC (RFC 2898) using `digest.` == Synopsis Declared in `<openssl/evp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int PKCS5_PBKDF2_HMAC( char const* pass, int passlen, unsigned char const* salt, int saltlen, int iter, xref:EVP_MD.adoc[EVP_MD] const* digest, int keylen, unsigned char* out); ---- == Return Value 1 on success, or 0 on failure. == Parameters [cols="1,4"] |=== | Name| Description | *pass* | Password bytes, or NULL. | *passlen* | Length of `pass` in bytes, or ‐1 to use strlen(`pass).` | *salt* | Salt bytes, or NULL when `saltlen` is 0. | *saltlen* | Length of `salt` in bytes. | *iter* | Iteration count (should be greater than zero). | *digest* | HMAC digest algorithm (for example EVP_sha256()). | *keylen* | Desired derived‐key length in bytes. | *out* | Buffer that receives the derived key of `keylen` bytes. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#