Re: How to do encryption using AES in Openssl

2012-03-30 Thread Ben Laurie
On Thu, Mar 29, 2012 at 5:40 AM, Prashanth kumar N < prashanth.kuma...@gmail.com> wrote: > Thanks Ken for pointing out the mistake... after changing to > AES_Decrypt(), it worked but i still see issue when i print the > decrypted output as it has extra non-ascii characters in it. > > Below is the

RE: How to do encryption using AES in Openssl

2012-03-29 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Prashanth kumar N > Sent: Thursday, 29 March, 2012 10:02 > Bit confusing... are you saying that i need to add NULL termination > at the end of encrypted data? Isn't this wrong? I assume i shouldn't be > NULL terminating the

Re: How to do encryption using AES in Openssl

2012-03-29 Thread Dr. Stephen Henson
On Thu, Mar 29, 2012, Prashanth kumar N wrote: > Thanks Marek. If i select CBC mode encryption and i have data which is > not aligned to block, i assume padding will be taken by the API's itself. > Only if you use EVP. For low level APIs you have to manually add and remove padding. Steve. -- Dr

Re: How to do encryption using AES in Openssl

2012-03-29 Thread Prashanth kumar N
ssl.org > > > > 03/29/2012 04:03 PM > > > > Please respond to > > openssl-users@openssl.org > > > > To > > > > openssl-users@openssl.org > > > > cc > > > > Subject > > > > Re: How to do encryption using AES in

Re: How to do encryption using AES in Openssl

2012-03-29 Thread Marek . Marcola
ssl.org > > 03/29/2012 04:03 PM > > Please respond to > openssl-users@openssl.org > > To > > openssl-users@openssl.org > > cc > > Subject > > Re: How to do encryption using AES in Openssl > > Bit confusing... are you saying that i need t

Re: How to do encryption using AES in Openssl

2012-03-29 Thread Prashanth kumar N
Bit confusing... are you saying that i need to add NULL termination at the end of encrypted data? Isn't this wrong? I assume i shouldn't be NULL terminating the input string which needs to be encrypted. On Thu, Mar 29, 2012 at 7:10 PM, Ken Goldman wrote: > On 3/29/2012 1:40 AM, Prashanth kumar

Re: How to do encryption using AES in Openssl

2012-03-29 Thread Prashanth kumar N
Stephen, Does it mean we can't use AES without IV ? As per XTS support in Openssl, i find the following function but don't see any implementation for the same AES_xts_encrypt(). I found the below link form which what i understand is new file called e_aes_xts.c should be present... am i missing so

Re: How to do encryption using AES in Openssl

2012-03-29 Thread Ken Goldman
On 3/29/2012 1:40 AM, Prashanth kumar N wrote: Thanks Ken for pointing out the mistake... after changing to AES_Decrypt(), it worked but i still see issue when i print the decrypted output as it has extra non-ascii characters in it. That's what happens in C if you try to printf an array that's

Re: How to do encryption using AES in Openssl

2012-03-29 Thread Dr. Stephen Henson
On Thu, Mar 29, 2012, Prashanth kumar N wrote: > Thanks Marek. I will try the attached code in the attached files. > In many of the examples i have come across, i see IV is always being. Is it > not possible to use this API by setting IV to NULL? (As i understand for > CBC IV is a must) . In AES_E

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Prashanth kumar N
; owner-openssl-us...@openssl.org wrote on 03/28/2012 09:01:25 AM: > > > Prashanth kumar N > > Sent by: owner-openssl-us...@openssl.org > > > > 03/28/2012 09:03 AM > > > > Please respond to > > openssl-users@openssl.org > > > > To > > > > o

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Prashanth kumar N
Thanks Ken for pointing out the mistake... after changing to AES_Decrypt(), it worked but i still see issue when i print the decrypted output as it has extra non-ascii characters in it. Below is the input unsigned char text[]="test12345678abc2"; After decryption, i get the following string: Decr

RE: How to do encryption using AES in Openssl

2012-03-28 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Prashanth kumar N > Sent: Wednesday, 28 March, 2012 03:01 > As i read min AES block size is 128 bits which can go up to > 256 bits in multiples of 32-bits. Is this correct? No but almost. The *algorithm* Rijndael designed b

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Marek . Marcola
> 03/28/2012 09:06 AM > > Please respond to > openssl-users@openssl.org > > To > > openssl-users@openssl.org > > cc > > Subject > > Re: How to do encryption using AES in Openssl > > I tried to use EVP but let if of go due to bad documen

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Ben Laurie
On Tue, Mar 27, 2012 at 8:26 PM, Ken Goldman wrote: > On 3/27/2012 3:51 PM, Jakob Bohm wrote: > >> On 3/27/2012 9:37 PM, Dr. Stephen Henson wrote: >> >>> You should really be using EVP instead of the low level routines. >>> They are well documented with examples. >>> >> Where, precisely? >> >> I

Re: OpenSSL Wiki (was: How to do encryption using AES in Openssl)

2012-03-28 Thread Jeffrey Walton
On Wed, Mar 28, 2012 at 3:03 AM, Prashanth kumar N wrote: > Jeff.. this is good idea... so are you going to start one? No, this is something best left to the OpenSSL project. Otherwise, you'll have a bunch of fractured documentation sprayed all over the web. Jeff > On Wed, Mar 28, 2012 at 6:15 A

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Ken Goldman
I agree with you in general. I assumed the OP was just experimenting. I use the raw AES_encrypt() because the standard I'm complying to uses a non-standard counter mode. I had to construct it from scratch. On 3/28/2012 10:56 AM, Marek.Marcola- wrote: If you want to use low-level AES functi

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Marek . Marcola
012 09:03 AM > > Please respond to > openssl-users@openssl.org > > To > > openssl-users@openssl.org > > cc > > Subject > > Re: How to do encryption using AES in Openssl > > Here is the modified program > > #include > 2 #include > 3

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Ken Goldman
On 3/28/2012 3:01 AM, Prashanth kumar N wrote: Here is the modified program [snip] 18 AES_KEY ectx; 19 AES_KEY dectx; 20 21 AES_set_encrypt_key(key, 256, &ectx); 22 AES_encrypt(text, out, &ectx); 23 24 printf("encryp data = %s\n", out); 25 26 AES_set_encr

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Prashanth kumar N
I agree with this as it has made many life's easy ... On Wed, Mar 28, 2012 at 12:48 PM, nudge wrote: > As an independent follower of this list, I'd just like say that even if > the documentation has its critics, the support provided here is > incredibly good ! > > > On Wed, Mar 28, 2012, at 12:3

Re: How to do encryption using AES in Openssl

2012-03-28 Thread nudge
As an independent follower of this list, I'd just like say that even if the documentation has its critics, the support provided here is incredibly good ! On Wed, Mar 28, 2012, at 12:32 PM, Prashanth kumar N wrote: > I tried to use EVP but let if of go due to bad documentation... > > On Wed, Mar

Re: OpenSSL Wiki (was: How to do encryption using AES in Openssl)

2012-03-28 Thread Prashanth kumar N
Jeff.. this is good idea... so are you going to start one? -Prashanth On Wed, Mar 28, 2012 at 6:15 AM, Jeffrey Walton wrote: > On Tue, Mar 27, 2012 at 4:26 PM, Ken Goldman wrote: > > On 3/27/2012 3:51 PM, Jakob Bohm wrote: > >> > >> On 3/27/2012 9:37 PM, Dr. Stephen Henson wrote: > >>> > >>> Y

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Prashanth kumar N
I tried to use EVP but let if of go due to bad documentation... On Wed, Mar 28, 2012 at 2:49 AM, Jakob Bohm wrote: > On 3/27/2012 10:42 PM, Jeffrey Walton wrote: > >> On Tue, Mar 27, 2012 at 4:26 PM, Ken Goldman wrote: >> >>> On 3/27/2012 3:51 PM, Jakob Bohm wrote: >>> On 3/27/2012 9:37 PM

Re: How to do encryption using AES in Openssl

2012-03-28 Thread Prashanth kumar N
Here is the modified program #include 2 #include 3 4 static const unsigned char key[] = { 5 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 6 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 7 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 8 0x08, 0x09, 0x0a, 0x

OpenSSL Wiki (was: How to do encryption using AES in Openssl)

2012-03-27 Thread Jeffrey Walton
On Tue, Mar 27, 2012 at 4:26 PM, Ken Goldman wrote: > On 3/27/2012 3:51 PM, Jakob Bohm wrote: >> >> On 3/27/2012 9:37 PM, Dr. Stephen Henson wrote: >>> >>> You should really be using EVP instead of the low level routines. >>> They are well documented with examples. >> >> Where, precisely? >> >> I

Re: How to do encryption using AES in Openssl

2012-03-27 Thread Jeffrey Walton
On Tue, Mar 27, 2012 at 5:19 PM, Jakob Bohm wrote: > On 3/27/2012 10:42 PM, Jeffrey Walton wrote: >> >> On Tue, Mar 27, 2012 at 4:26 PM, Ken Goldman  wrote: >>> >>> On 3/27/2012 3:51 PM, Jakob Bohm wrote: On 3/27/2012 9:37 PM, Dr. Stephen Henson wrote: > > You should really be us

Re: How to do encryption using AES in Openssl

2012-03-27 Thread Jakob Bohm
On 3/27/2012 10:42 PM, Jeffrey Walton wrote: On Tue, Mar 27, 2012 at 4:26 PM, Ken Goldman wrote: On 3/27/2012 3:51 PM, Jakob Bohm wrote: On 3/27/2012 9:37 PM, Dr. Stephen Henson wrote: You should really be using EVP instead of the low level routines. They are well documented with examples. W

Re: How to do encryption using AES in Openssl

2012-03-27 Thread Jeffrey Walton
On Tue, Mar 27, 2012 at 4:26 PM, Ken Goldman wrote: > On 3/27/2012 3:51 PM, Jakob Bohm wrote: >> >> On 3/27/2012 9:37 PM, Dr. Stephen Henson wrote: >>> >>> You should really be using EVP instead of the low level routines. >>> They are well documented with examples. >> >> Where, precisely? >> >> I

Re: How to do encryption using AES in Openssl

2012-03-27 Thread Ken Goldman
On 3/27/2012 3:51 PM, Jakob Bohm wrote: On 3/27/2012 9:37 PM, Dr. Stephen Henson wrote: You should really be using EVP instead of the low level routines. They are well documented with examples. Where, precisely? I didn't find it either when I was looking a few years ago, so I settled on the ob

Re: How to do encryption using AES in Openssl

2012-03-27 Thread Jakob Bohm
On 3/27/2012 9:37 PM, Dr. Stephen Henson wrote: On Tue, Mar 27, 2012, pkumarn wrote: I am trying to write a sample program to do AES encryption using Openssl. I tried going through Openssl documentation( it's a pain), could not figure out much. I went through the code and found the API's using

Re: How to do encryption using AES in Openssl

2012-03-27 Thread Dr. Stephen Henson
On Tue, Mar 27, 2012, pkumarn wrote: > > I am trying to write a sample program to do AES encryption using Openssl. I > tried going through Openssl documentation( it's a pain), could not figure > out much. I went through the code and found the API's using which i wrote a > small program as below (

Re: How to do encryption using AES in Openssl

2012-03-27 Thread Ken Goldman
On 3/27/2012 1:33 PM, pkumarn wrote:> I am trying to write a sample program to do AES encryption using Openssl. I tried going through Openssl documentation( it's a pain), could not figure out much. I went through the code and found the API's using which i wrote a small program as below (please om

How to do encryption using AES in Openssl

2012-03-27 Thread pkumarn
help me to figure this out... -- View this message in context: http://old.nabble.com/How-to-do-encryption-using-AES-in-Openssl-tp33544797p33544797.html Sent from the OpenSSL - User mailing list archive at Nabble.com. __ OpenSSL