Hi
 
What is your Key size ?
 
The size of the Key equals the size of the modulus, which is the minimum size of a block.
 
For instance
If your key size equals 1024 bits (128 bytes) and your input plain[] is of size 8 and it will padded to the modulus size since you are using OAEP then your out[] byte array should be of size 128.
 
for more information about RSAES-OAEP
http://www.rsasecurity.com/rsalabs/node.asp?id=2148#OAEP
 
 
Haytham

MERT <[EMAIL PROTECTED]> wrote:

....

byte out[100];
FileSource keys("c:\\privkey.txt", true, new HexDecoder);
RSAES_OAEP_SHA_Decryptor rsaPriv(keys);
FileSource pubkeys("c:\\pubkey.txt", true, new HexDecoder);
RSAES_OAEP_SHA_Encryptor rsaPub(pubkeys);

memset(out, 0, 100);
rsaPub.Encrypt(GlobalRNG(), plain, 8, out);

.....

My aim is encryption of a byte array via RSA. I do not want any file or
string source.
Input byte array, ouput encrypted byte array.
The above code gives run time error. I am open to any idea that makes
encryption.
No problem with files that keep keys. I knew it because I made the
encryption via StringSink. Please recorrect my code or rewrite a piece of
code that makes byte array encryption.
Thanks for your effort, best wishes ...
--
View this message in context: http://www.nabble.com/Encrypt-byte-array-via-RSA-without-file-or-string-source-t1290052.html#a3432179
Sent from the Crypto++ forum at Nabble.com.


Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.

Reply via email to