PKCS5_v2_PBE_keyivgen_ex

Derive a key and IV with PKCS#5 PBES2 and initialize ctx for encrypt/decrypt.

Synopsis

Declared in <openssl/evp.h>

int
PKCS5_v2_PBE_keyivgen_ex(
    EVP_CIPHER_CTX* ctx,
    char const* pass,
    int passlen,
    ASN1_TYPE* param,
    EVP_CIPHER const* cipher,
    EVP_MD const* md,
    int en_de,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
ctxCipher context to initialize.
passPassword bytes, or NULL.
passlenLength of pass in bytes, or -1 to use strlen(pass).
paramASN.1 PBES2 parameters describing KDF and cipher settings.
cipherCipher algorithm to initialize (may be taken from param).
mdDigest used by the KDF when required by the parameters.
en_de1 to encrypt, or 0 to decrypt.
libctxLibrary context for algorithm fetches, or NULL for the default.
propqProperty query string for provider selection, or NULL.