Thank You Richard

What I was thinking was to append the length at the start to the plain text and then send it for encryption and while after decryption read the length and only send that much data.



Richard Levitte <[EMAIL PROTECTED]> wrote:
Bhupendra K Joshi writes:

> The problem is when I give say 10 bytes of data to AES_cbc_encrypt(with AES_ENCRYPT), I get 16 bytes of encrypted data and when I pass the same 16 bytes of encrypted data to AES_cbc_encrypt(with AES_DECRYPT) I get 16 bytes of decrypted data.
>
> How can I determine the actual data decryption length.

You have to encode the length into the data you encrypt, and after
decryption, you have to use that encoded length to determine the length of
the decrypted plain text.

It might be easier for you to use the EVP API. It will add som padding
which also contains length information, so you will get decryped plain text
with the length you expect.

Cheers,
Richard

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.
--
Richard Levitte [EMAIL PROTECTED]
http://richard.levitte.org/

"When I became a man I put away childish things, including
the fear of childishness and the desire to be very grown up."
-- C.S. Lewis

______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]


Discover Yahoo!
Use Yahoo! to plan a weekend, have fun online & more. Check it out!

Reply via email to