Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAMEEVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryption
#include <openssl/evp.h> int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk); int EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl); int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
EVP_SealInit() initializes a cipher context ctx for encryption with cipher type using a random secret key and
The iv parameter is a buffer where the generated
If the cipher does not require an
EVP_SealUpdate() and EVP_SealFinal() have exactly the same properties as the EVP_EncryptUpdate() and EVP_EncryptFinal() routines, as documented on the EVP_EncryptInit(3) manual page.
RETURN VALUESEVP_SealInit() returns 0 on error or npubk if successful.
EVP_SealUpdate() and EVP_SealFinal() return 1 for success and 0 for failure.
NOTESBecause a random secret key is generated the random number generator must be seeded before calling EVP_SealInit().
The public key must be
Envelope encryption is the usual method of using public key encryption on large amounts of data, this is because public key encryption is slow but symmetric encryption is fast. So symmetric encryption is used for bulk encryption and the small random symmetric key used is transferred using public key encryption.
It is possible to call EVP_SealInit() twice in the same way as EVP_EncryptInit(). The first call should have npubk set to 0 and (after setting any cipher parameters) it should be called again with type set to