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