On 11/20/2012 11:38 AM, coderl wrote:
Hi,

How can I set the EVP padding size to 32byte instead of 16?

I currently have the problem, using aes 256bit, that if I encrypt a 20 or 30
size block it will only encrypt 16bytes instead of the whole part.


That is not what the padding does.

Padding *increases* the encrypted size by 1 to P bytes so it is
a multiple of P bytes total.  A padding of 16 would cause encryption
of 20 or 30 bytes to result in an encrypted value of 32 bytes.

What you need to check is:

- Did you pass the right input data size to the encrypt function?

- Did you use a function that actually does padding?

- Did you use a function that encrypts only onedata block (16 bytes
 for AES 256)?

- Did you use the correct functions but forget the call that said
 that there are no more bytes after your 20 or 30 bytes (until you
 do, the code will hold back the 4 or 14 extra bytes until it knows
 if it should be followed by more data or padding).

Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S. http://www.wisemo.com
Transformervej 29, 2730 Herlev, Denmark. Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to