RE: openssl AES decrypt problem

2012-12-13 Thread Dave Thompson
>From: owner-openssl-us...@openssl.org On Behalf Of Hailei Hu >Sent: Thursday, 13 December, 2012 06:27 >Thanks to your reply. >The first solution: >"you can set the length parameter on the decrypt operation to be 16 which will >provide you with a result that is your original 10 bytes plus 6 bytes

Re: openssl AES decrypt problem

2012-12-12 Thread engineereeyore
The problem is that aes_cbc is a block cipher and works on 16-byte blocks, typically. By default, any data block that is less than this size is padded, as is the case for you. Since you're only sending in 10 bytes, your 10 bytes are being padded with zeros to make the block 16 bytes. So, to answ

Re: openssl AES decrypt problem

2012-12-12 Thread Ken Goldman
A typical method is to use PKCS#7 padding. On 12/12/2012 9:07 AM, Hailei Hu wrote: Hi, everyone! I am testing openssl AES encrypt and decrypt using AES_cbc_encrypt. for example, I have a file which has 10 bytes, after using AES_cbc_encrypt, the encrypted file become 16 bytes. But when