| Use Case | Function | Description |
|---|---|---|
| π Symmetric encryption | EVP_EncryptInit_ex() | Initialize a cipher context with key and IV |
| #οΈβ£ Message digest | EVP_DigestInit_ex() | Initialize a message digest context |
| βοΈ Sign data | EVP_DigestSignInit() | Initialize signing after digesting the message |
| π§ Digital envelope (publicβkey enc) | EVP_SealInit() | Encrypt a session key with a public key |
| π¦ Base64 encoding | EVP_EncodeInit() | Initialize Base64 encoding / decoding |
| π Asymmetric key gen | EVP_PKEY_keygen() | Generate a new key pair |
#include <openssl/evp.h>
π§ The EVP library provides a high-level interface to cryptographic functions.
π§ The EVP_SealXXX and EVP_OpenXXX functions provide public key encryption and decryption to implement digital "envelopes".
βοΈ The EVP_DigestSignXXX and EVP_DigestVerifyXXX functions implement digital signatures and Message Authentication Codes (MACs). Also see the older EVP_SignXXX and EVP_VerifyXXX functions.
π Symmetric encryption is available with the EVP_EncryptXXX functions. The EVP_DigestXXX functions provide message digests.
π The EVP_PKEYXXX functions provide a high-level interface to asymmetric algorithms. To create a new EVP_PKEY see EVP_PKEY_new(3). EVP_PKEYs can be associated with a private key of a particular algorithm by using the functions described on the EVP_PKEY_fromdata(3) page, or new keys can be generated using EVP_PKEY_keygen(3). EVP_PKEYs can be compared using EVP_PKEY_eq(3), or printed using EVP_PKEY_print_private(3). EVP_PKEY_todata(3) can be used to convert a key back into an OSSL_PARAM(3) array.
π The EVP_PKEY functions support the full range of asymmetric algorithm operations:
π The EVP_BytesToKey(3) function provides some limited support for password based encryption. Careful selection of the parameters will provide a PKCS#5 PBKDF1 compatible implementation. However, new applications should not typically use this (preferring, for example, PBKDF2 from PCKS#5).
π¦ The EVP_EncodeXXX and EVP_DecodeXXX functions implement base 64 encoding and decoding.
βοΈ All the symmetric algorithms (ciphers), digests and asymmetric algorithms (public key algorithms) can be replaced by ENGINE modules providing alternative implementations. If ENGINE implementations of ciphers or digests are registered as defaults, then the various EVP functions will automatically use those implementations automatically in preference to built in software implementations. For more information, consult the engine(3) man page.
β οΈ Although low-level algorithm specific functions exist for many algorithms their use is discouraged. They cannot be used with an ENGINE and ENGINE versions of new algorithms cannot be accessed using the low- level functions. Also makes code harder to adapt to new algorithms and some options are not cleanly supported at the low-level and some operations are more efficient using the high-level interface.
Generated by phpman v4.9.22-1-g1b0fcb4 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-05 16:43 @216.73.216.52
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format