The problem with the NULL pointer exception was also my mistake. But thanks to your program I found it and now -- ring ring -- I have a decrypted content.
BUT The content at my example is 128 byte long (as long as the RSA signature). The original hash that was signed was 32 byte long. I find the orignial hash inside the decrypted content. It lays on the last 32 byte. Before this is mostly FF. How do I surely get the original hash out of the content? Frank Wockenfuß -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Marek Marcola Gesendet: Donnerstag, 2. August 2007 18:00 An: openssl-users@openssl.org Betreff: Re: RSA_public_decrypt problem UPDATE Hello, > I have found the reason for the problem. Deep inside my program was a bug > that switched modulus and exponent, so I set the wrong values to n and e. My first suggestion :-) > I've fixed the bug and also removed the leading 00 so that I get a good 128 > byte long modulus and a 4 byte long exponent. Leading 00 are important, if first byte is greater then 127 this number may be treated as negative. > If I call RSA_verify I get now the reason 155 as error description. > If I call RSA_public_decrypt I get a NULL pointer access violation. > > What can I do now? RSA_public_decrypt() with RSA_NO_PADDING should work good only with these data. First RSA_public_decrypt() should work, next you may try RSA_verify() because core of this function is RSA_public_decrypt() :-) You should carefully check parameters of RSA_public_decrypt() ! Best regards, -- Marek Marcola <[EMAIL PROTECTED]> ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]