On 15 April 2013 12:48, Anil Kumar K K <aniluvc...@gmail.com> wrote: > Hi OpenSSL Team, > > I am Anil, trying to code aes encryption and decryption program using > openssl library. > > I have coded a program which takes key and data as inputs and computes > AES-128 cipher text and decrypt the same. If the size of the data/Key > changes, size of cipher text is also getting changed .Is it expected > behavior ? >
Some further points in addition to Jakob's analysis. Firstly, and most importantly, you are using the wrong API for basic AES encryption. You are using the underlying block cipher directly rather than using it in conjunction with a mode (which by default means you are using ECB mode). This is almost certainly NOT want you want, and has all sorts of security implications. Typical modes would be CBC, CTR, GCM etc. To do this properly you should use the EVP api. I suggest you start here: http://wiki.opensslfoundation.com/index.php/EVP http://wiki.opensslfoundation.com/index.php/EVP_Symmetric_Encryption_and_Decryption Matt ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org