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

Name

Description

ctx

Cipher context to initialize.

pass

Password bytes, or NULL.

passlen

Length of pass in bytes, or ‐1 to use strlen(pass).

param

ASN.1 PBES2 parameters describing KDF and cipher settings.

cipher

Cipher algorithm to initialize (may be taken from param).

md

Digest used by the KDF when required by the parameters.

en_de

1 to encrypt, or 0 to decrypt.

libctx

Library context for algorithm fetches, or NULL for the default.

propq

Property query string for provider selection, or NULL.

Created with MrDocs