Hello,
> int encSize = RSA_public_encrypt(size, inText, sigBuffer, rsaPubKey,
> RSA_PKCS1_OAEP_PADDING);
> if(encSize == -1)
> {
> cout << "error encrytping with public key" << endl;
> return -1;
> }
> int decryptRetVal = RSA_private_decrypt(encSize, sigBuffer, plainText,
> rsaPrivKey, RSA_PKCS1_OA
Hi Marek and David,
Thank you both for your help. I applied both of your advice and It
looks like I've got things working now. As David said I was not
keeping track of the size of the encoded data, thus when it came time
to decrypt I was providing the wrong value in the flen parameter.
Hello,
> > > > RSA_public_encrypt(size, inText, sigBuffer, rsaPubKey,
> > > > RSA_PKCS1_OAEP_PADDING);
>
> > > Ooops, you just threw away the return value from
> > > RSA_public_encrypt. So how
> > > are you going to know how big the signature is?
>
> > RSA_size()
>
> I thought RSA_size gave the
> > > RSA_public_encrypt(size, inText, sigBuffer, rsaPubKey,
> > > RSA_PKCS1_OAEP_PADDING);
> > Ooops, you just threw away the return value from
> > RSA_public_encrypt. So how
> > are you going to know how big the signature is?
> RSA_size()
I thought RSA_size gave the modulus size, which is als
Hello,
> > RSA_public_encrypt(size, inText, sigBuffer, rsaPubKey,
> RSA_PKCS1_OAEP_PADDING);
>
> Ooops, you just threw away the return value from RSA_public_encrypt. So how
> are you going to know how big the signature is?
RSA_size()
Best regards,
--
Marek Marcola <[EMAIL PROTECTED]>
__
> RSA_public_encrypt(size, inText, sigBuffer, rsaPubKey,
RSA_PKCS1_OAEP_PADDING);
Ooops, you just threw away the return value from RSA_public_encrypt. So how
are you going to know how big the signature is?
> sigretVal = RSA_size(rsaPrivKey);
> unsigned char *plainText = new unsigned char[sigretV
Hello,
>
> #include
> #include "openssl/rsa.h"
> #include "openssl/pem.h"
> #include "openssl/err.h"
>
>
> using namespace std;
> int main ()
> {
> RSA *rsaPrivKey = RSA_new();
Check error code !
> RSA *rsaPubKey = RSA_new();
Check error code !
> unsigned char inText[512];
>
>
> ERR_load_c
Hello,
Extreme noob to openssl, and am running into problems using the
crypto library for RSA encryption and decryption. For now I'm just
putting together a simplistic test application to get a feel for
using the openssl libs. The problem I'm having is when I try to
decrypt an encrypte