Re: AES CBC Padding question

2013-01-04 Thread Matt Caswell
With PKCS padding there is always between 1 and 16 padding bytes added (for AES). The value of the padding bytes is equal to the number of padding bytes added, so if one padding byte has been added then the value "0x01" will be added, for two padding bytes then "0x0202" will be added, for three "0x

AES CBC Padding question

2013-01-04 Thread Roar Lien
Hi, I am experiencing an issue that has to do with the PKCS padding. I am using AES with CBC mode. When padding is enabled and the plain text buffer is size a multiple of the block size, the call to 'EVP_EncryptFinal_ex()' adds an entire extra block to the cipher text. If the input is a multiple