
AI_MD5WithXOR
136 RSA BSAFE Crypto-C Library Reference Manual
AI_MD5WithXOR
Purpose:
This AI is used for encrypting the file keys. This algorithm implements a variant of
password-based encryption. The data being encrypted is XORed with a secret key
derived from a password, and it can be successfully decrypted only when the correct
password is provided. Since the secret key is a 128-bit output of MD5 message digest
algorithm, the data being encrypted should be no longer than 128 bits. A description
of MD5 can be found in RFC 1321.
Type of information this allows you to use:
the salt and iteration count for the MD5 With “exclusive or” (XOR) password-based
encryption algorithm. The salt is concatenated with the password before being
digested by MD5, and the iteration count specifies how many times the digest needs
to be run. The count of 2 indicates that the result of digesting password-and-salt
string needs to be run once more through MD5. The final digest is XORed with the
data to obtain the encryption.
Format of info supplied to B_SetAlgorithmInfo:
pointer to a B_PBE_PARAMS structure:
Format of info returned by B_GetAlgorithmInfo:
pointer to a B_PBE_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 char *salt; /* pointer to 8-byte salt value */
unsigned int iterationCount; /* iteration count */
} B_PBE_PARAMS ;