A SERVICE OF

logo

AI_RSAPrivate
210 RSA BSAFE Crypto-C Library Reference Manual
AI_RSAPrivate
Purpose:
This AI allows you to encrypt data using the raw RSA algorithm. You can find the
description of this algorithm in B. Schneier's
Applied Cryptography
.
AI_RSAPrivate is different from AI_PKCS_RSAPrivate because the former allows you
to encrypt raw data, while the latter encrypts data in PKCS #1 format.
Because this algorithm does not pad, the total number of input bytes must be a
multiple of the key’s modulus size in bytes. Your application is responsible for
padding the data as appropriate. 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 do this, divide your data into blocks that are one byte smaller than
the modulus, and prepend one byte of zeros to each block.
To perform RSA encryption you can also use
AI_PKCS_RSAPrivate and
AI_SET_OAEP_RSAPrivate. But you can use AI_RSAPrivate only if the data will be
decrypted with
AI_RSAPublic.
Type of information this allows you to use:
the RSA algorithm for performing raw private-key encryption.
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.