Re: RSA encryption/decryption with OpenSSL.

2013-08-22 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of mycompuser > Sent: Wednesday, 21 August, 2013 01:35 > Thanks for the reply. > I do have access to the server code but cannot change it's > implementation to > suite my requirement as the server is serving other clients in other > platforms as

RE: Re: RSA encryption/decryption with OpenSSL.

2013-08-21 Thread mycompuser
icKey rsaPubKey = (RSAPublicKey)rsaKeyFac.generatePublic(keySpec); return rsaPubKey; } -- View this message in context: http://openssl.6102.n7.nabble.com/RSA-encryption-decryption-with-OpenSSL-tp46234p46259.html Sent from the OpenSSL - User mailing list archive at Nabbl

Re: RSA encryption/decryption with OpenSSL.

2013-08-21 Thread mycompuser
in PEM format, can I still use the same RSA object to decrypt data? -- View this message in context: http://openssl.6102.n7.nabble.com/RSA-encryption-decryption-with-OpenSSL-tp46234p46247.html Sent from the OpenSSL - User

RE: Re: RSA encryption/decryption with OpenSSL.

2013-08-20 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Ken Goldman > Sent: Tuesday, 20 August, 2013 08:08 > On 8/19/2013 3:15 PM, mycompuser wrote: > > But the only > > problem that I currently face is that the key pair > generated by OpenSSL has > > headers and footers of the form -BEGIN RSA P

Re: RSA encryption/decryption with OpenSSL.

2013-08-20 Thread Ken Goldman
On 8/19/2013 3:15 PM, mycompuser wrote: But the only problem that I currently face is that the key pair generated by OpenSSL has headers and footers of the form -BEGIN RSA PUBLIC KEY- -END RSA PUBLIC KEY- for public key likewise there is similar header and footer for private key a

RSA encryption/decryption with OpenSSL.

2013-08-20 Thread mycompuser
context: http://openssl.6102.n7.nabble.com/RSA-encryption-decryption-with-OpenSSL-tp46234.html Sent from the OpenSSL - User mailing list archive at Nabble.com. __ OpenSSL Project http://www.openssl.or

Re: Problems with RSA encryption/decryption

2007-08-13 Thread Marek Marcola
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

Re: Problems with RSA encryption/decryption

2007-08-13 Thread Dan Spirlock
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.

RE: Problems with RSA encryption/decryption

2007-08-13 Thread Marek Marcola
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

RE: Problems with RSA encryption/decryption

2007-08-13 Thread David Schwartz
> > > 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

RE: Problems with RSA encryption/decryption

2007-08-13 Thread Marek Marcola
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]> __

RE: Problems with RSA encryption/decryption

2007-08-13 Thread David Schwartz
> 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

Re: Problems with RSA encryption/decryption

2007-08-13 Thread Marek Marcola
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

Problems with RSA encryption/decryption

2007-08-13 Thread Dan Spirlock
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

Re: RSA encryption/decryption programming

2005-05-10 Thread Sebastian
Sure, take a look at http://www.openssl.org/docs/crypto/crypto.html. Renember to link against libcrypto... Sebastian cranium2003 wrote: hello, I want to write a RSA encryption decryption program in C that encrypt data on one pc sends that encrypted data to other pc and get it decrypted on

RSA encryption/decryption programming

2005-05-09 Thread cranium2003
hello, I want to write a RSA encryption decryption program in C that encrypt data on one pc sends that encrypted data to other pc and get it decrypted on that other pc provided both pcs have Linux Platform. But i dont know how to use openssl to program in C. I know how to create

Re: RSA Encryption/Decryption.

2005-05-09 Thread Layla
Thank you :)Sebastian <[EMAIL PROTECTED]> wrote: Hmm,take a look at routines like RSA_new() to create RSA structures. As you coded 'sizeof apub', this will return the size of a _pointer_ - assuming a 32-bit architecture you will get round about four bytes ;-).See: http://www.openssl.org/docs/crypto

Re: RSA Encryption/Decryption.

2005-05-09 Thread Sebastian
Hmm, take a look at routines like RSA_new() to create RSA structures. As you coded 'sizeof apub', this will return the size of a _pointer_ - assuming a 32-bit architecture you will get round about four bytes ;-). See: http://www.openssl.org/docs/crypto/RSA_new.html The runtime error is caused b

RSA Encryption/Decryption.

2005-05-08 Thread Layla
Hi all,   I'm trying to develop a C++ application to encrypt and decrypt data using RSA public key cryptography scheme. I have generated the public/private keys using OpenSSL command line tool. The following C++ code should read a public key, encrypt data, read private key and decrypt the data: **

Re: RSA encryption/decryption time confusion (discrepancy?)

2005-03-03 Thread Nils Larsch
Vishwas wrote: Dear SSLites, Please observe the following operations. I do the following:- key1 = RSA_generate_key(n, e1, NULL, NULL); num = RSA_private_encrypt(plen, ptext_ex, ctext, key1, RSA_PKCS1_PADDING); RSA_public_decrypt(num, ctext, ptext, key1, RSA_PKCS1_PADDING); Average encryption time i

RSA encryption/decryption time confusion (discrepancy?)

2005-03-03 Thread Vishwas
Dear SSLites, Please observe the following operations. I do the following:- key1 = RSA_generate_key(n, e1, NULL, NULL); num = RSA_private_encrypt(plen, ptext_ex, ctext, key1, RSA_PKCS1_PADDING); RSA_public_decrypt(num, ctext, ptext, key1, RSA_PKCS1_PADDING); Average encryption time is = 5463361