[#PKCS5_v2_PBE_keyivgen]
= PKCS5&lowbar;v2&lowbar;PBE&lowbar;keyivgen
:mrdocs:

Derive a key and IV from a PKCS&num;5 v2 PBE AlgorithmIdentifier and initialize `ctx&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS5&lowbar;v2&lowbar;PBE&lowbar;keyivgen(
    xref:EVP_CIPHER_CTX.adoc[EVP&lowbar;CIPHER&lowbar;CTX]* ctx,
    char const* pass,
    int passlen,
    xref:ASN1_TYPE.adoc[ASN1&lowbar;TYPE]* param,
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* cipher,
    xref:EVP_MD.adoc[EVP&lowbar;MD] const* md,
    int en&lowbar;de);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Cipher context to initialize for encryption or decryption&period;
| *pass*
| Password bytes&period;
| *passlen*
| Length of `pass,` or &hyphen;1 if `pass` is a NUL&hyphen;terminated string&period;
| *param*
| ASN&period;1 parameters from the PBE AlgorithmIdentifier&period;
| *cipher*
| Cipher suggested by the caller (may be overridden by `param)&period;`
| *md*
| Digest suggested by the caller (may be overridden by `param)&period;`
| *en&lowbar;de*
| Non&hyphen;zero to encrypt, zero to decrypt&period;
|===


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