BIO_set_cipher

Configure a cipher filter BIO with algorithm, key, IV, and encrypt/decrypt mode.

Synopsis

Declared in <openssl/evp.h>

int
BIO_set_cipher(
    BIO* b,
    EVP_CIPHER const* c,
    unsigned char const* k,
    unsigned char const* i,
    int enc);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
bBIO created with BIO_f_cipher().
cCipher algorithm to use.
kKey bytes whose length matches the cipher's key length.
iIV bytes whose length matches the cipher's IV length (may be NULL for ECB).
enc1 to encrypt, or 0 to decrypt.