Hi, I'm trying to crypt with a secret+public key I load from a file. So what I do is: - i read in the binary representation of n and d, I then convert those with BN_bin2bn to pRsakeypair -> n and d. - after that, I set the exponent e: BN_zero(pRsakeypair -> e) BN_set_word(pRsakeypair -> e, 65537) all those functions succeed (I check *ALL* returnvalues). then, I try to encrypt with the secret key:
nKeysize is the length of the binary representation of the key in bytes, so for a 4096 bits key this nKeysize is 512 bytes long. now every time I ran this: if (RSA_private_encrypt(nKeysize, in, out, pRsakeypair, RSA_NO_PADDING) == -1) I get the error: error:04066084:rsa routines:RSA_EAY_PRIVATE_ENCRYPT:data too large for modulus how come? Folkert. ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]