Examples to encrypt/decrypt
Hi Could you please provide examples to encrypt/decrypt 256 char length of data using AES256 algorithm Thanks and Regards C V Rao
Re: Examples to encrypt/decrypt
This will do what you want: http://agabrielson.wordpress.com/2010/07/15/openssl-an-example-from-the-command-line/ - Original Message - From: Venkateswara Rao Chikkireddi (HSSL-Bangalore) cv...@hp.com To: openssl-users@openssl.org Sent: Friday, March 25, 2011 12:41:36 PM Subject: Examples to encrypt/decrypt Hi Could you please provide examples to encrypt/decrypt 256 char length of data using AES256 algorithm Thanks and Regards C V Rao
Re: Examples to encrypt/decrypt
On Fri, Mar 25, 2011 at 3:56 PM, Anthony Gabrielson agabriels...@comcast.net wrote: This will do what you want: http://agabrielson.wordpress.com/2010/07/15/openssl-an-example-from-the-command-line/ memset(plaintext,0,sizeof(plaintext)); The optimizer might remove your zeroization. Jeff - Original Message - From: Venkateswara Rao Chikkireddi (HSSL-Bangalore) cv...@hp.com To: openssl-users@openssl.org Sent: Friday, March 25, 2011 12:41:36 PM Subject: Examples to encrypt/decrypt Hi Could you please provide examples to encrypt/decrypt 256 char length of data using AES256 algorithm Thanks and Regards C V Rao __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager majord...@openssl.org
RE: Examples to encrypt/decrypt
From: Jeffrey Walton Sent: Friday, March 25, 2011 8:45 PM On Fri, Mar 25, 2011 at 3:56 PM, Anthony Gabrielson agabriels...@comcast.net wrote: This will do what you want: http://agabrielson.wordpress.com/2010/07/15/openssl-an-example-from-the-command-line/ memset(plaintext,0,sizeof(plaintext)); The optimizer might remove your zeroization. Jeff But only if has a bug, in which case it might do anything.__ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager majord...@openssl.org
Re: Examples to encrypt/decrypt
On 3/25/2011 4:17 PM, Jeremy Farrell wrote: From: Jeffrey Walton Sent: Friday, March 25, 2011 8:45 PM On Fri, Mar 25, 2011 at 3:56 PM, Anthony Gabrielsonagabriels...@comcast.net wrote: This will do what you want: http://agabrielson.wordpress.com/2010/07/15/openssl-an-example-from-the-command-line/ memset(plaintext,0,sizeof(plaintext)); The optimizer might remove your zeroization. Jeff But only if has a bug, in which case it might do anything. It can remove it even without a bug. It's a common optimization to remove an assignment that the optimizer can prove has no effects. Since the 'memset' is the last reference to 'plaintext', the optimizer can legally remove it. DS __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager majord...@openssl.org
RE: Examples to encrypt/decrypt
From: David Schwartz [mailto:dav...@webmaster.com] Sent: Friday, March 25, 2011 11:44 PM On 3/25/2011 4:17 PM, Jeremy Farrell wrote: From: Jeffrey Walton Sent: Friday, March 25, 2011 8:45 PM On Fri, Mar 25, 2011 at 3:56 PM, Anthony Gabrielsonagabriels...@comcast.net wrote: This will do what you want: http://agabrielson.wordpress.com/2010/07/15/openssl-an-example-from-the-command-line/ memset(plaintext,0,sizeof(plaintext)); The optimizer might remove your zeroization. Jeff But only if has a bug, in which case it might do anything. It can remove it even without a bug. It's a common optimization to remove an assignment that the optimizer can prove has no effects. Since the 'memset' is the last reference to 'plaintext', the optimizer can legally remove it. I think there must be some confusion here. The compiler can certainly do anything strange that it likes as long as the program can't tell by any C-conformant means that it has done so. Stripping pointless code is one of the simplest example of that. In this case though 'plaintext' is referenced again after both calls to 'memset'. The code in question is at http://web.me.com/agabrielson/code/test_AES.c, linked from the page mentioned above.__ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager majord...@openssl.org
Re: Examples to encrypt/decrypt
On Mar 25, 2011, at 4:45 PM, Jeffrey Walton wrote: On Fri, Mar 25, 2011 at 3:56 PM, Anthony Gabrielson agabriels...@comcast.net wrote: This will do what you want: http://agabrielson.wordpress.com/2010/07/15/openssl-an-example-from-the-command-line/ memset(plaintext,0,sizeof(plaintext)); The optimizer might remove your zeroization. Jeff Hi Jeff, Yup, the compiler may do all kinds of crazy things during optimization. That sample code is actually based on some other code that I found on the web that had major problems. The web example had a bug, so I added the memset to help debug it. I noticed (with the help of memset) that the decrypt statement was in fact not working at all. I fixed the example and the code eventually turned became the example on the website. Further, the memory thats being memset is also used again, several times - so although I'll admit that I haven't looked at the assembly, I think its working as expected. Do you see a real bug in the calls to OpenSSL? If so I would like to fix it - I'll be the first to admit I make mistakes. If you look further through the blog you will see an OpenSSL toolbox for Matlab. I was interested in looking at several interactions and the toolbox helped me do that. The sample code was the basis for that toolbox, and although I haven't used the code in awhile, it was working as expected during exploration. Anyway, I hope folks like the example - Anthony