RE: EVP_DecryptFinal_ex:bad decrypt

2009-02-16 Thread David Schwartz
> buff = (char *)malloc(bptr->length); > memcpy(buff, bptr->data, bptr->length-1); > buff[bptr->length-1] = 0; Umm, you don't copy the last byte of data. You don't allocate enough space to hold the data and a terminator. This is probably your main error. How will 'buff' hold a C-style string wh

RE: EVP_DecryptFinal_ex:bad decrypt

2009-02-16 Thread David Schwartz
> When i use to encrypt data, i have not problems.. when i > decrypt the result of this code, i have not problem... > when i decrypt with this program, i have > 13015:error:06065064:digital envelope routines: > EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:461: > The EVP_DecryptUpdate works ok, dec

Re: EVP_DecryptFinal_ex:bad decrypt

2007-11-10 Thread Harald Latzko
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_Dec