I have an application where an application may switch from reading to
writing and back again at random. I've determined that either I need a ctx context each for decryption / encryption, or I use the same ctx in sequence on the file.


I presume that I need to detect this change and call EVP_CipherInit_ex to alter the context ctx accordingly. However, do I need to call
EVP_CipherFinal first to finalize the ctx for the prior mode?


My next question involves the encryption of very short strings (less
than the cipher block size)... does the ctx "buffer" these short strings until either another call to the Update function fills out the
block and/or the Final function is called? I will have unpredictable
string lengths being encrypted, and I do not want to introduce padding into the middle of the encrypted files.


Thanks for your help...

- Eric Morris
  NC State University




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

Reply via email to