The CRYPT_RC2_CBC_PARAMETERS structure is used when the object identifier for encryption is szOID_RSA_RC2CBC. It is used in calls to CryptEncodeObject, CryptEncodeObjectEx, CryptDecodeObject CryptDecodeObjectEx using PKCS_RC2_CBC_PARAMETERS.
typedef struct _CRYPT_RC2_CBC_PARAMETERS {
DWORD dwVersion;
BOOL fIV; // set if has following IV
BYTE rgbIV[8];
} CRYPT_RC2_CBC_PARAMETERS, *PCRYPT_RC2_CBC_PARAMETERS;
Currently defined values for dwVersion are shown in the following table.
Encoding type | Value |
---|---|
CRYPT_RC2_40BIT_VERSION | 160 |
CRYPT_RC2_64BIT_VERSION | 120 |
CRYPT_RC2_128BIT_VERSION | 58 |
The IV is encoded as an OCTET_STRING.
CryptEncodeObject and CryptEncodeObjectEx (X500_OCTET_STRING) can be called to create the encoded OCTET_STRING. The ContentEncryptionAlgorithm's Parameters blob is updated to point to this encoded OCTET_STRING.
Note, when a message is decrypted, if it has an IV parameter, then, the cryptographic message functions will call CryptSetKeyParam with the IV before doing the decrypt.
CMSG_ENVELOPED_ENCODE_INFO, CRYPT_ENCRYPT_MESSAGE_PARA, PKCS_RC2_CBC_PARAMETERS, CryptEncodeObject, CryptSetKeyParam