I understand that, when encrypting, the last block have to be padded to encrypt it and so i do, but i dont save to the encrypted file the padded bytes, because i need the encrypted data to be the same size than original.
You have to save the entire encrypted block. cipher_final will tell you the length of the padded and encrypted block.
What i dont understand is, if i enable padding on decrypt too, why EVP_CipherFinal_ex fails to pad it? Should i pad it myself before starting to decrypt?
The EVP_CIPHER_CTX_set_padding only applies to encryption, and is enabled by default - so you don't need it anywhere. When decrypting cipher_final will tell you the length of the decrypted data. Jim ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]