EVP_SealFinal (3)
Leading comments
Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) Standard preamble: ========================================================================
NAME
EVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryptionSYNOPSIS
#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);
DESCRIPTION
TheEVP_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 VALUES
EVP_SealInit() returns 0 on error or npubk if successful.EVP_SealUpdate() and EVP_SealFinal() return 1 for success and 0 for failure.
NOTES
Because 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