[#PKCS5_PBKDF2_HMAC_SHA1]
= PKCS5&lowbar;PBKDF2&lowbar;HMAC&lowbar;SHA1
:mrdocs:

Derive a key from a password with PBKDF2&hyphen;HMAC&hyphen;SHA1 (RFC 2898)&period;

== Synopsis

Declared in `&lt;openssl&sol;evp&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS5&lowbar;PBKDF2&lowbar;HMAC&lowbar;SHA1(
    char const* pass,
    int passlen,
    unsigned char const* salt,
    int saltlen,
    int iter,
    int keylen,
    unsigned char* out);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pass*
| Password bytes, or NULL&period;
| *passlen*
| Length of `pass` in bytes, or &hyphen;1 to use strlen(`pass)&period;`
| *salt*
| Salt bytes, or NULL when `saltlen` is 0&period;
| *saltlen*
| Length of `salt` in bytes&period;
| *iter*
| Iteration count (should be large&semi; typically at least 1000)&period;
| *keylen*
| Desired derived key length in bytes&period;
| *out*
| Buffer of at least `keylen` bytes that receives the derived key&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
