AI_RSAPrivate

AI_RSAPublic

AI_RSAPublic

Purpose:

This AI allows you to decrypt data using the raw RSA algorithm. You can find the description of this algorithm in B. Schneier's Applied Cryptography.

AI_RSAPublic is different from AI_PKCS_RSAPublic because the latter allows you to decrypt k-11 bytes, where k is the size of the modulus in bytes, while you can use the former to decrypt up to k bytes. Note that it is the application’s responsibility to strip the padding that was appended by the application to the data during encryption with

.

Because this algorithm does not pad, the total number of input bytes must be a multiple of the key’s modulus size in bytes. Also, each modulus-size block of input, interpreted as an integer with the most significant byte first, must be numerically less than the key's modulus.

To perform RSA decryption you can also use AI_PKCS_RSAPublic and

AI_SET_OAEP_RSAPublic. But you can use AI_RSAPublic only if the data has been encrypted with AI_RSAPrivate.

Type of information this allows you to use:

the RSA algorithm for performing raw public-key decryption.

Format of info supplied to B_SetAlgorithmInfo:

NULL_PTR.

Format of info returned by B_GetAlgorithmInfo:

NULL_PTR.

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.

2 1 4

R S A B S A F E C r y p t o - C L i b r a r y R e f e r e n c e M a n u a l

Page 224
Image 224
RSA Security 5 manual AIRSAPublic, RSA algorithm for performing raw public-key decryption