Initialize ctx for encryption or decryption using the default implementation.

Synopsis

Declared in <openssl/evp.h>

int
EVP_CipherInit(
    EVP_CIPHER_CTX* ctx,
    EVP_CIPHER const* cipher,
    unsigned char const* key,
    unsigned char const* iv,
    int enc);

Return Value

1 on success, or 0 on failure.

Parameters

Name

Description

ctx

Cipher context to initialize.

cipher

Cipher algorithm, or NULL to reuse the current algorithm.

key

Key bytes, or NULL to set later.

iv

Initialization vector, or NULL when not required / set later.

enc

Non‐zero to encrypt, zero to decrypt.

Created with MrDocs