Hi all,
I wrote a program which generates an RSA key pair using
RSA_generate_key(), then I store the private and public keys in buffers
using i2d_RSAPublicKey() and i2d_RSAPrivateKey(). I later use the
d2i_RSAPublicKey()/d2i_RSAPrivateKey() to reproduce the keys for
encryption and decryption - using
RSA_private_encrypt()/RSA_public_decrypt and
RSA_public_encrypt()/RSA_private_decrypt() - with RSA_NO_PADDING to
encrypt/decrypt blocks of 128 bytes with 1024 bit keys.
This works fine, except sometimes it doesn't. Given the same key, 2
buffers which are the same except for the first byte will produce
completely different results on decryption. One will produce a perfect
cleartext and the other will produce complete garbage. There are usually
value ranges (per key) for the 1st byte for which the decryption will
work perfectly, and the rest of the values give garbage.
Does anyone have an idea what I could be doing wrong?
Thanks in advance,
Noam
--
Noam Ben-Yochanan
Technologies Team Leader
Whale Communications Ltd.
Phone: +972-3-9031101 (Ext 319)
Fax: +972-3-9031102
E-mail: [EMAIL PROTECTED]
http://www.whale-com.com
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]