Re: Decryption does not yield the same as Encryption

2009-02-16 Thread Ger Hobbelt
On Fri, Feb 13, 2009 at 4:42 PM, Rafel Coyle wrote: > I am encrypting prior to encoding. The encryption coding is below. > > Also, I tried the coding changes below that were recommended and got the > same results. Any other ideas? Not at the moment. Given that your error is at position 15 of t

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

EVP_DecryptFinal_ex:bad decrypt

2009-02-16 Thread José Hidalgo C .
Hi i'm having problems with the function EVP_DecryptFinal_ex... i have the next code: #include #include #include #include #include #include #include #include #include #include #include #include #define LEN_KEY 16 #define ENC_SIZE 512000 #define MSG_SIZE 512000 #define ENCRIPTA 1

RE: len of encrypted data

2009-02-16 Thread David Schwartz
> Hi... a simple question, i hope somebody know the solution: > I need to use the EVP_DecryptUpdate... but for fifth argument, > i need the large of encrypted.. how i do this? i'm sure that > strlen not works... You cannot have a chunk of data without knowing how big it is. What it means to "h

len of encrypted data

2009-02-16 Thread José Hidalgo C .
Hi... a simple question, i hope somebody know the solution: I need to use the EVP_DecryptUpdate... but for fifth argument, i need the large of encrypted.. how i do this? i'm sure that strlen not works... Thanks!!!

Re: how to trace aes quickly?

2009-02-16 Thread Victor Duchovni
On Mon, Feb 16, 2009 at 01:48:54PM +0800, loody wrote: > Dear all: > I want to realize aes, so I trace enc_main in enc.c. > But I find there are a lot call back functions such that I spend more > time on tracing these call back functions than understanding aes > algorithm. > > I have studied the

PKCS#7 symmetric keys

2009-02-16 Thread Carl Young
Hi all, With OpenSSL, can I create PKCS#7 CMS messages just using a pre-shared symmetric key? I just need to package the secret with its encryption algorithm identifier, and the PKCS#7 envelope looks ideal for this. The only additional data that I may wish to add to the message may be the

How I can add new hash function to openssl

2009-02-16 Thread Rustam Rakhimov
Hi for all How I can add new hash function to openssl ?