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

Derive a PBE key and IV and initialize `ctx` for encryption&sol;decryption (PKCS &num;5 v1&period;5)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS5&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&period;
| *pass*
| Password octets (may be NULL if `passlen` is 0)&period;
| *passlen*
| Password length in bytes, or &hyphen;1 to use strlen(`pass)&period;`
| *param*
| ASN&period;1 PBE parameters (salt, iteration count, and related fields)&period;
| *cipher*
| Cipher algorithm used for PBE&period;
| *md*
| Digest used by the PBE key derivation&period;
| *en&lowbar;de*
| 1 to encrypt, or 0 to decrypt&period;
|===


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