Hello Pankaj,

Am 09.11.2007 um 23:33 schrieb Pankaj Mathur:

Hi ,

I am trying to encrypt and decrypt a large file using the Openssl API. I am doing this by calling EVP_EncryptUpdate / EVP_DecryptUpdate iteratively for a block size of 1024 and then calling the EVP_EncryptFinal_ex/ EVP_DecryptFinal_ex respectively in the end. It always fails to decrypt for file sizes greater than 1024 bytes (which is the size of the block in which I am encrypting / decrypting). If I increase the blocksize to say 2048 and then it only encrypts files with 2048 bytes or less. The error I get is "5790:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:461:" I have used the standard methods and I am unable to see any problems with this code. Can anybody please help in identifying the problem? I am using Openssl version 0.9.8e
If you're interested in encrypting large files, you may be interested in the streaming support of openssl 0.9.9dev. In the command line tool "openssl" there's is switch "-stream" for enabling this feaure when using "openssl smime -encrypt ...". The other way round (decrypting) doesn't support the stream support, so if you (or anybody else) have a solution for that, I would be very interested in it, since I'm searching a way to decrypt the files created by openssl with itself. The same works for signing files (where the stream support is missing in the verify process).

Regards,
Harald

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

Reply via email to