Encrypts a plaintext buffer using the given DES parameters and key.
#include "hudes.h"
int hu_DESEncryptMsg(sb_Params desParams, sb_Key desKey, size_t ivLen, const unsigned char *iv, size_t length, const unsigned char *plaintext, unsigned char *ciphertext, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
A DES parameters object.
A DES key object.
The length (in bytes) of the initial vector. The only acceptable value is SB_DES_IV_SIZE.
The initial vector.
The length (in bytes) of plaintext. The acceptable values are multiples of SB_DES_BLOCK_SIZE.
The plaintext buffer.
The ciphertext buffer.
A global context.
An initial vector is required for the SB_DES_CBC, SB_DES_CFB64 and SB_DES_OFB64 modes of operation. iv is ignored for SB_DES_ECB, as an initial vector is not required for that mode. The plaintext and ciphertext buffers must be the same length, and may overlap in memory subject to the constraints described in the API Reference section on overlapping buffers.
Note: This function should only be called for blocks of plaintext and ciphertext that can be stored entirely in memory.
The desParams object is NULL.
The tag for the params object is not of the expected type.
The desKey object is NULL.
The desKey object is invalid.
The initial vector, iv, is NULL.
The length of the initial vector, ivLen, is invalid.
The plaintext buffer is NULL.
The ciphertext buffer is NULL.
Success.