|
| WOLFSSL_API int | wc_Des_SetKey (Des *des, const byte *key, const byte *iv, int dir) |
| | This function sets the key and initialization vector (iv) for the Des structure given as argument. It also initializes and allocates space for the buffers needed for encryption and decryption, if these have not yet been initialized. Note: If no iv is provided (i.e. iv == NULL) the initialization vector defaults to an iv of 0.
|
| |
| WOLFSSL_API void | wc_Des_SetIV (Des *des, const byte *iv) |
| | This function sets the initialization vector (iv) for the Des structure given as argument. When passed a NULL iv, it sets the initialization vector to 0.
|
| |
| WOLFSSL_API int | wc_Des_CbcEncrypt (Des *des, byte *out, const byte *in, word32 sz) |
| | This function encrypts the input message, in, and stores the result in the output buffer, out. It uses DES encryption with cipher block chaining (CBC) mode.
|
| |
| WOLFSSL_API int | wc_Des_CbcDecrypt (Des *des, byte *out, const byte *in, word32 sz) |
| | This function decrypts the input ciphertext, in, and stores the resulting plaintext in the output buffer, out. It uses DES encryption with cipher block chaining (CBC) mode.
|
| |
| WOLFSSL_API int | wc_Des_EcbEncrypt (Des *des, byte *out, const byte *in, word32 sz) |
| | This function encrypts the input message, in, and stores the result in the output buffer, out. It uses Des encryption with Electronic Codebook (ECB) mode.
|
| |
| WOLFSSL_API int | wc_Des3_EcbEncrypt (Des3 *des, byte *out, const byte *in, word32 sz) |
| |
| WOLFSSL_API int | wc_Des3_SetKey (Des3 *des, const byte *key, const byte *iv, int dir) |
| | This function sets the key and initialization vector (iv) for the Des3 structure given as argument. It also initializes and allocates space for the buffers needed for encryption and decryption, if these have not yet been initialized. Note: If no iv is provided (i.e. iv == NULL) the initialization vector defaults to an iv of 0.
|
| |
| WOLFSSL_API int | wc_Des3_SetIV (Des3 *des, const byte *iv) |
| | This function sets the initialization vector (iv) for the Des3 structure given as argument. When passed a NULL iv, it sets the initialization vector to 0.
|
| |
| WOLFSSL_API int | wc_Des3_CbcEncrypt (Des3 *des, byte *out, const byte *in, word32 sz) |
| | This function encrypts the input message, in, and stores the result in the output buffer, out. It uses Triple Des (3DES) encryption with cipher block chaining (CBC) mode.
|
| |
| WOLFSSL_API int | wc_Des3_CbcDecrypt (Des3 *des, byte *out, const byte *in, word32 sz) |
| | This function decrypts the input ciphertext, in, and stores the resulting plaintext in the output buffer, out. It uses Triple Des (3DES) encryption with cipher block chaining (CBC) mode.
|
| |
|
WOLFSSL_API int | wc_Des3Init (Des3 *, void *, int) |
| |
|
WOLFSSL_API void | wc_Des3Free (Des3 *) |
| |
| WOLFSSL_API int wc_Des3_EcbEncrypt |
( |
Des3 * | des, |
|
|
byte * | out, |
|
|
const byte * | in, |
|
|
word32 | sz ) |
\ingroup 3DES
\brief This function encrypts the input message, in, and stores the
result in the output buffer, out. It uses Des3 encryption with
Electronic Codebook (ECB) mode. Warning: In nearly all use cases ECB
mode is considered to be less secure. Please avoid using ECB API’s
directly whenever possible.
\return 0 Returned upon successfully encrypting the given plaintext
\param des3 pointer to the Des3 structure to use for encryption
\param out pointer to the buffer in which to store the encrypted message
\param in pointer to the input buffer containing the plaintext to encrypt
\param sz length of the plaintext to encrypt
_Example_
/code
Des3 enc; // Des3 structure used for encryption
initialize enc with wc_Des3_SetKey, use mode DES_ENCRYPTION
byte plain[] = { // initialize with message to encrypt };
byte cipher[sizeof(plain)];
if ( wc_Des3_EcbEncrypt(&enc,cipher, plain, sizeof(plain)) != 0) {
error encrypting message } /endcode
- See also
- wc_Des3_SetKey