Hello David,

Can you show me exactly how to break up my example code to make my example
work? I tried removing the EVP_DecryptFinal_ex from my DecryptMessage
function and just seeing if the first part would just decrypt the first 7
bytes, but it got thrown into my catch statement. I am really confused.

Thanks,
Christina Penn

On Tue, May 4, 2010 at 6:42 PM, David Schwartz <dav...@webmaster.com> wrote:

>
> Christina Penn wrote:
>
> > Here is some example code of me trying to decrypt a partial AES message.
> > It doesn't work.. is there a way I can do something like this? It only
> works
> > if I call DecryptMessage() with the entire encrypted string. Why?
>
> Your DecryptMessage function is specifically designed to require the entire
> encrypted string:
>
>        if(!EVP_DecryptFinal_ex(&deCTX, plaintext+p_len, &f_len))
>            cerr << "ERROR in EVP_DecryptFinal_ex" << endl;
>
> See how it calls EVP_DecryptFinal_ex?
>
> As EVP_DecryptInit should only be called at the very start to initialize a
> message, so EVP_DecryptFinal_ex should only be called at the very end to
> finish a complete message. In the middle, you should only be using
> EVP_DecryptUpdate.
>
> DS
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           majord...@openssl.org
>

Reply via email to