[#EVP_EncryptInit] = EVP_EncryptInit :mrdocs: Initialize `ctx` for encryption with `cipher,` `key,` and `iv.` == Synopsis Declared in `<openssl/evp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int EVP_EncryptInit( xref:EVP_CIPHER_CTX.adoc[EVP_CIPHER_CTX]* ctx, xref:EVP_CIPHER-07.adoc[EVP_CIPHER] const* cipher, unsigned char const* key, unsigned char const* iv); ---- == Return Value 1 on success, or 0 on failure. == Parameters [cols="1,4"] |=== | Name| Description | *ctx* | Cipher context to initialize (must already be allocated). | *cipher* | Cipher algorithm, or NULL to reuse the previous cipher while setting a new key/IV. | *key* | Encryption key bytes, or NULL to set the cipher without a key yet. | *iv* | Initialization vector, or NULL when the cipher does not use an IV or the IV is set later. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#