![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/8/e1/8e19318c-ae01-425c-b15f-c70b26f2bca2/8e19318c-ae01-425c-b15f-c70b26f2bca2-bgbc.png)
AI_RC2_CBC
178 RSA BSAFE Crypto-C Library Reference Manual
AI_RC2_CBC
Purpose:
This AI allows you to perform RC2 encryption or decryption in CBC mode with an 8-
byte initialization vector. During encryption, this algorithm does not pad the output.
Thus, you must provide input that is a multiple of 8 bytes. See
AI_RC2_CBCPad for the
same algorithm with padding. RC2 is a variable-key-size block cipher, which means
that the key can be anywhere between 1 and 128 bytes. The larger the key, the greater
the security. RC2 is described in RFC 2268, and the CBC mode is similar to the one
described in RFC 2040.
Other algorithms that can be used for encryption/decryption in CBC mode without
padding are
AI_DES_CBC_IV8, AI_DES_EDE3_CBC_IV8, AI_DESX_CBC_IV8, and
AI_RC5_CBC.
Type of information this allows you to use:
an effective key size and an 8-byte initialization vector for the RC2-CBC encryption
algorithm.
Format of info supplied to B_SetAlgorithmInfo:
pointer to an A_RC2_CBC_PARAMS structure:
Format of info returned by B_GetAlgorithmInfo:
pointer to an A_RC2_CBC_PARAMS structure (see above).
Crypto-C procedures to use with algorithm object:
B_EncryptInit, B_EncryptUpdate, B_EncryptFinal, B_DecryptInit,
B_DecryptUpdate, and B_DecryptFinal. You may pass (B_ALGORITHM_OBJ)NULL_PTR
for all
randomAlgorithm
arguments.
typedef struct {
unsigned int effectiveKeyBits; /* effective key size in bits */
unsigned char *iv; /* initialization vector */
} A_RC2_CBC_PARAMS;