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
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
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
> 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
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
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
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
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
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
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
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
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
__
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
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
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
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
; 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
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
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
>
| 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
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
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
@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
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
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
[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
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
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
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
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
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
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]>
___
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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:
**
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
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
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
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
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.
_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]
>
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
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
-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
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
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
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
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
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
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
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
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
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
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
74 matches
Mail list logo