CRYPT_RC2_CBC_PARAMETERS

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;
 

Members

dwVersion
Specifies the key length (40, 64 or 128 bits). Note that the values used on the defined constants differ from the lengths specified.

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

fIV
A Boolean that specifies whether an 8 byte Initialization Vector is contained in rgbIV[8]. Set to TRUE when IV is present.
rgbIV[8]
Contains the 8 byte Initialization Vector, when present.

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.

See Also

CMSG_ENVELOPED_ENCODE_INFO, CRYPT_ENCRYPT_MESSAGE_PARA, PKCS_RC2_CBC_PARAMETERS, CryptEncodeObject, CryptSetKeyParam