Re: RSA encryption/decryption with OpenSSL.

2013-08-22 Thread Dave Thompson
in other > platforms as well. > > Below is the java code to encrypt an AES symmetric key with > the public key > it recieves from the client. After encryption, the size of > the data is about > 176 characters. > (Pure) RSA encryption for a 1024-bit key is 128 bytes, wh

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: RSA encryption and Decryption code in C language

2013-07-02 Thread yamini
Hello Enrico, Thanks for the code! It really helped. Regards, yamini. -- View this message in context: http://openssl.6102.n7.nabble.com/RSA-encryption-and-Decryption-code-in-C-language-tp45588p45759.html Sent from the OpenSSL - User mailing list archive at Nabble.com

RSA encryption for DES session key code in C language

2013-07-02 Thread yamini
Hello, I have chosen DES encryption for encrypting the data and RSA encryption for encrypting the session key (DES key). I have to write this task in C language using openSSL. So it would be great if anyone helps me with sample code snippets or list of the functions that can be used to do this

Re: RSA encryption and Decryption code in C language

2013-06-18 Thread Ken Goldman
You cannot generate a private key from a public key. Typically, the receiver generates the key pair and sends the public key to the sender. The sender encrypts with the public key. The receiver decrypts with the private key. A typical format for sending a public key across a channel is an X

Re: RSA encryption and Decryption code in C language

2013-06-18 Thread Hemayamini Kurra
e DES algorithm between my client and server systems >> for >> encryption. The DES key is transmitted in encrypted form between Client >> and >> Server using RSA encryption and decryption. >> My idea of implementing the above task is creating RSA key >> (RSA_g

RE: RSA encryption and Decryption code in C language

2013-06-18 Thread enrico d'urso
Hi, I'm implementing a software very similar to yours. This is a small function that I used to generate private and public key: #include int main() { char * file_pem = "key_priv"; char * file_pem_pub = "key_pub"; FILE * fp; int bits = 1024; unsigned long exp = RSA_F4; RS

Re: RSA encryption and Decryption code in C language

2013-06-18 Thread Matt Caswell
On 18 June 2013 09:43, Michel wrote: > Hi Yamini, > > I would suggest looking at the 'EVP Envelope' API : > https://www.openssl.org/docs/crypto/EVP_SealInit.html > Also see: http://wiki.openssl.org/index.php/EVP_Asymmetric_Encryption_and_Decryption_of_an_Envelope Matt __

Re: RSA encryption and Decryption code in C language

2013-06-18 Thread Michel
encrypted form between Client and Server using RSA encryption and decryption. My idea of implementing the above task is creating RSA key (RSA_generate_key) and using the public key for encryption and private key for decryption. I have looked for sample codes to do this in C language but found noth

RSA encryption and Decryption code in C language

2013-06-18 Thread yamini
Hello, I am implementing the DES algorithm between my client and server systems for encryption. The DES key is transmitted in encrypted form between Client and Server using RSA encryption and decryption. My idea of implementing the above task is creating RSA key (RSA_generate_key) and using the

How to support ECB mode with RSA encryption

2008-12-08 Thread liansm
Hi All, Does anybody know how to enable the ECB mode with the RSA encryption? I know there are some function to support the ECB mode for the symmetric ciphers, but I didn't find any function to support ECB/CBC mode for the RSA encryption, I am wondering if there is any option to su

RE: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-19 Thread Peter Walker
g the stuff anyway ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ger Hobbelt Sent: 18 September 2008 10:21 To: openssl-users@openssl.org Subject: Re: Do you have to pre-pend 16 bytes to a raw value before RSA encryption :-) Well, the 'funny&#x

Re: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-19 Thread Ger Hobbelt
; So as a noob, I just wanted to know if that is the correct requirement > of RSA or a requirement of my parent companies web service only? > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Michael Sierchio > Sent: 17 September 2008 22:48

RE: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-18 Thread Peter Walker
19:25 To: openssl-users@openssl.org Subject: RE: Do you have to pre-pend 16 bytes to a raw value before RSA encryption Peter Walker wrote: > Sorry if this sounds ultra noobish but you guys lost me, even though you > probably did answer my question ;) > > The purpose of my application

RE: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-18 Thread David Schwartz
Peter Walker wrote: > Sorry if this sounds ultra noobish but you guys lost me, even though you > probably did answer my question ;) > > The purpose of my application is to send a credit card number in > encrypted format. > > So the parent companies webservice issues me a X509 certificate which >

Re: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-18 Thread Goetz Babin-Ebell
| Subject: Re: Do you have to pre-pend 16 bytes to a raw value before RSA | encryption | | Peter Walker wrote: | |> The purpose of my application is to send a credit card number in |> encrypted format. | | Then use OAEP. For that the upstream server must also use OAEP. Since it obviously d

RE: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-18 Thread Peter Walker
value before RSA encryption Peter Walker wrote: > The purpose of my application is to send a credit card number in > encrypted format. Then use OAEP. - M __ OpenSSL Project http://www.opens

Re: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-18 Thread Michael Sierchio
Peter Walker wrote: > The purpose of my application is to send a credit card number in > encrypted format. Then use OAEP. - M __ OpenSSL Project http://www.openssl.org User Support Mailing List

RE: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-18 Thread Peter Walker
@openssl.org Subject: Re: Do you have to pre-pend 16 bytes to a raw value before RSA encryption Kenneth Goldman wrote: > What padding are you specifying? I suspect that you are specifying > no padding, in which case the size of the input must be the same > as the size of the key. No. The

Re: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-17 Thread Michael Sierchio
Kenneth Goldman wrote: > What padding are you specifying? I suspect that you are specifying > no padding, in which case the size of the input must be the same > as the size of the key. No. The input is the same size as the *modulus*. When used in encryption the recommended approach for RSA is

RE: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-17 Thread Peter Walker
Goldman Sent: 17 September 2008 15:47 To: openssl-users@openssl.org Subject: Re: Do you have to pre-pend 16 bytes to a raw value before RSA encryption [EMAIL PROTECTED] wrote on 09/17/2008 08:10:09 AM: > I just completed writing my first program using libcrypto to handle > RSA encryption

Re: Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-17 Thread Kenneth Goldman
[EMAIL PROTECTED] wrote on 09/17/2008 08:10:09 AM: > I just completed writing my first program using libcrypto to handle > RSA encryption sing a public key extracted from a X509 certificate. > This program communicates with a service created by our parent company. > > The first

Do you have to pre-pend 16 bytes to a raw value before RSA encryption

2008-09-17 Thread Peter Walker
I just completed writing my first program using libcrypto to handle RSA encryption sing a public key extracted from a X509 certificate. This program communicates with a service created by our parent company. The first attempts that I made to run my program against the service, resulted in an

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

Re: RSA encryption and decryption performance difference between pkcs11 engine and default engine on windows and solaris

2007-02-14 Thread AD D
durgaprasad jammula, thank you for your help, I do think T2000 (sun sparc machine) has the hardware accelerator for RSA encryption, but I also test the performance on an amd64 machine (dell optiplex 745, a desktop pc), I think there should not be hardware accelerator in the dell amd64 machine

Re: RSA encryption and decryption performance difference between pkcs11 engine and default engine on windows and solaris

2007-02-14 Thread durgaprasad jammula
7 1:05:10 PM Subject: RSA encryption and decryption performance difference between pkcs11 engine and default engine on windows and solaris Hi, I use openssl RSA encrypt and decrypt both on windows 2003 and solaris (amd64 and sparc T2000). I wrote some performance test cod

RSA encryption and decryption performance difference between pkcs11 engine and default engine on windows and solaris

2007-02-13 Thread AD D
LL); interval = (tpsend.tv_sec - tpsbegin.tv_sec) * 100; interval += tpsend.tv_usec; interval -= tpsbegin.tv_usec; interval = interval / 1000; printf("RSA enc and dec %d times %d\n", i, interval); At first, I ran the code on windows, 100 times RSA encryption an

Re: RSA encryption

2006-08-03 Thread Marek Marcola
Hello, > Actually this should be the private key. Not the public key. > > RSA_size(prvKey->pkey.rsa) In general - yes, but size of private and public key must be the same for RSA. Best regards, -- Marek Marcola <[EMAIL PROTECTED]> ___

Re: RSA encryption

2006-08-03 Thread Kaushalye Kapuruge
Yeah I rectified it . Sorry I forgot to have u guys posted... :) Actually this should be the private key. Not the public key. RSA_size(prvKey->pkey.rsa) Really appreciate Ur help, Kaushalye Marek Marcola wrote: Hello, Change: strlen((char*)encrypted) to: RSA_size(pubKey->pke

Re: RSA encryption

2006-08-03 Thread Marek Marcola
Hello, Change: strlen((char*)encrypted) to: RSA_size(pubKey->pkey.rsa) Best regards, -- Marek Marcola <[EMAIL PROTECTED]> __ OpenSSL Project http://www.openssl.org User Support Ma

Re: RSA encryption

2006-08-02 Thread Kaushalye Kapuruge
Hi, Yeah it helped. Thanks. Then I wrote this code(attched) to encrypt and decrypt a text. I generated the private key using openssl genrsa -out rsakey2.pem 1024 And then the public key using openssl rsa -in rsakey2.pem -pubout > rsapub2.pem When I compile and run the test the encryption wo

Re: RSA encryption

2006-08-02 Thread Bernhard Froehlich
Kaushalye Kapuruge wrote: Hi, I'm trying to encrypt a Text using a session key and then encrypt that session key using the public key of the reciever side. Can anybody point me to an example in C? For this 1. I need to read the key using PEM format. http://www.openssl.org/docs/crypto/pem.html

RSA encryption

2006-08-02 Thread Kaushalye Kapuruge
Hi, I'm trying to encrypt a Text using a session key and then encrypt that session key using the public key of the reciever side. Can anybody point me to an example in C? For this 1. I need to read the key using PEM format. 2. Generate the session key. 3. Encrypt using RSA Also I'd like to kno

Re: RSA encryption and decryption question

2005-12-24 Thread Dr. Stephen Henson
On Sat, Dec 24, 2005, Arsen Hayrapetyan wrote: > When I am passing RSA_size(rsa) as the first argument to > RSA_private_decrypt(), I > am receiving the initial message decoded as "Test messageA". I have > allocated the > RSA_size(rsa) bytes for the buffer receiving the decodod text. Does the > dec

Re: RSA encryption and decryption question

2005-12-24 Thread jimmy
Arsen Hayrapetyan wrote: jimmy wrote: Arsen Hayrapetyan wrote: Hello, I have the following question: unsigned char *plaintext = "Test message"; unsigned char * ciphertext=NULL; RSA *rsa =...; /*here I have an RSA key */ RSA_public_encrypt(strlen(plaintext), plaintext, ciphertext, rsa, RSA

Re: RSA encryption and decryption question

2005-12-24 Thread Arsen Hayrapetyan
jimmy wrote: > Arsen Hayrapetyan wrote: > >> Hello, >> >> I have the following question: >> >> unsigned char *plaintext = "Test message"; >> unsigned char * ciphertext=NULL; >> RSA *rsa =...; /*here I have an RSA key */ >> >> RSA_public_encrypt(strlen(plaintext), plaintext, ciphertext, rsa, >> RS

Re: RSA encryption and decryption question

2005-12-24 Thread 劲吕
The length of ciphertext is not longer than the public key's length. If your public key is 1024bit, the length of ciphertext is 128 bytes. 2005/12/24, jimmy <[EMAIL PROTECTED]>: > Arsen Hayrapetyan wrote: > > Hello, > > > > I have the following question: > > > > unsigned char *plaintext = "Test me

Re: RSA encryption and decryption question

2005-12-24 Thread jimmy
Arsen Hayrapetyan wrote: Hello, I have the following question: unsigned char *plaintext = "Test message"; unsigned char * ciphertext=NULL; RSA *rsa =...; /*here I have an RSA key */ RSA_public_encrypt(strlen(plaintext), plaintext, ciphertext, rsa, RSA_PKCS1_OAEP_PADDIN*G* ); What will be the

RSA encryption and decryption question

2005-12-24 Thread Arsen Hayrapetyan
Hello, I have the following question: unsigned char *plaintext = "Test message"; unsigned char * ciphertext=NULL; RSA *rsa =...; /*here I have an RSA key */ RSA_public_encrypt(strlen(plaintext), plaintext, ciphertext, rsa, RSA_PKCS1_OAEP_PADDIN*G* ); What will be the length of ciphertext? Whe

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

Re: RSA encryption - to encrypt a c structure ??

2004-08-06 Thread Tan Eng Ten
First of all, you need to write functions that do serialization and de-serialization of your own C structure. Think about network programming, how do you send a C structure using sockets to a receipient? And having the receipient assemble it back into a C structure? Without such functions, any

Re: RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Jayashree Kanchana
Hi, My structure has 3 unsigned char arrays and I will have to move this encrypted data to other machines too. Following is the structure: typedef struct myStruct { unsigned char id[4]; unsigned char type; unsigned char Data[128]; } ; Can you pleas

Re: RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Michael Sierchio
Charles B Cranston wrote: Casting does not actually change the data, only the way in which it is treated by the program. Casting changes the way data are treated by the compiler. There is no string type in C, the semantics of nul-terminated strings are created in the behavior of certain functions.

RE : RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Marc Gaudichet
_decrypt (sizeof (szEncrypted), szEncrypted, (unsigned char *)&sStruct, &Rsa, RSA_PKCS1_PADDING); } I hope this helps. Marc. > -Message d'origine- > De : Jayashree Kanchana [mailto:[EMAIL PROTECTED] > Envoyé : mardi 3 août 2004 16:43 > À : [EMAIL PROTECTED] >

Re: RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Charles B Cranston
t the string back to your structure type. Marc. -Message d'origine- De : Jayashree Kanchana [mailto:[EMAIL PROTECTED] Envoy? : mardi 3 ao?t 2004 16:00 ? : [EMAIL PROTECTED] Objet : RSA encryption - to encrypt a c structure ?? Hi, I am hoping that someone might have come across this problem and

Re: RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Jayashree Kanchana
chana [mailto:[EMAIL PROTECTED] > > Envoyé : mardi 3 août 2004 16:00 > > À : [EMAIL PROTECTED] > > Objet : RSA encryption - to encrypt a c structure ?? > > > > > > Hi, > > > > I am hoping that someone might have come across this problem > > an

Re: RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Steven Bade
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jayashree Kanchana wrote: | Hi, | | I am hoping that someone might have come across this problem and will be | able to help me. | | I am trying to use openssl to encrypt a "c structure" instead of just a | "string", is there any function in openssl that

RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Marc Gaudichet
ROTECTED] > Objet : RSA encryption - to encrypt a c structure ?? > > > Hi, > > I am hoping that someone might have come across this problem > and will be able to help me. > > I am trying to use openssl to encrypt a "c structure" instead > of just a &q

RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Jayashree Kanchana
Hi, I am hoping that someone might have come across this problem and will be able to help me. I am trying to use openssl to encrypt a "c structure" instead of just a "string", is there any function in openssl that I could use? I have a RSA key structure that is already created and I am able to e

Re: Problem with RSA encryption zero byte

2004-04-21 Thread Ken Ballou
On Wed, Apr 21, 2004 at 09:38:49PM +0400, Alexander Krizhanovskiy wrote: > Hello! > > I'am using RSA_public_encrypt() and RSA_private_decrypt(). I can't encrypt > data with zero byte (for example hash data). My code like this: > > > unsigned char *buf = "null\x0null"; > . > RSA_public_encry

Problem with RSA encryption zero byte

2004-04-21 Thread Alexander Krizhanovskiy
Hello! I'am using RSA_public_encrypt() and RSA_private_decrypt(). I can't encrypt data with zero byte (for example hash data). My code like this: unsigned char *buf = "null\x0null"; . RSA_public_encrypt ( 9, buf, outbuf, rsa, RSA_PKCS1_PADDING); .. RSA_private_decrypt ( RSA_size(rsa), o

Re: RSA Encryption

2003-11-03 Thread Andrew Mann
s to a would be attacker? Generally, you can either encode your data in a more compact form and if you need hex translate it out on the other side, or you can break it into multiple blocks, encrypt and send each block. Andrew Mann [EMAIL PROTECTED] wrote: Hi.. I am using Crypto library of openSSL for

RSA Encryption

2003-11-03 Thread murari
Hi.. I am using Crypto library of openSSL for RSA encryption and decryption. I am generating RSA parameters for public modulus size of 1024. if I use RSA_public_encrypt() using PKCS1 padding and give an input string to encrypt of lenght 128, I get the following error: "5977:error:0406D06

RSA encryption

2002-06-24 Thread Federico Sauter
I got a question regarding RSA encryption: how do I encrypt/decrypt some text (or byte array, you understand what I mean) that is larger than RSA_key_size() ? Thanks in advance! _ Federico Sauter [EMAIL

RSA Encryption

2002-06-13 Thread Federico Sauter
Hi all! I am writing a function that should encrypt data using an RSA key. This should be no problem at all reading the documentation, but I have not fully understood how to encrypt data that is bigger than RSA_size(key) (or if I understood well, size - 11 or size - 41 depending on the padd

RSA encryption and decryption for data which is larger than RSA_SIZE

2002-05-21 Thread Michael Schmid
Hi, I'm trying to encrypt some data with rsa. The RSA_SIZE of my key is 128. The data can be more than 128 bit. So my idea was to encrypt the data using a loop which encrypts 128 bytes at once. I've read that there could be problems if the length is bigger than RSA_SIZE-1. So I set blockLengt

RSA encryption and decryption problem.....

2001-07-27 Thread MARS.LIN 林育德
Dear Mr., Thanks for your time reading this. I use the crypto library in openssl-0.9.6b.tar.gz, and configure into VC-WIN32. After setting up and compling, every thing works fine with the XXXtest.exe in out32dll directory. Then I try to use the file demos\eay\loadrsa.c and it works. I try to us