Title: 3 des implementation - help needed
encryption key & IV are only the state at start of encryption, this state evolves during encryption, so that if you store only the key and IV at the beginning of first packet, you must decrypt in same order as when you encrypted, this way the state evolves equivalently and it works
 
Regards
Armel
----- Original Message -----
Sent: Tuesday, September 07, 2004 2:13 PM
Subject: RE: 3 des implementation - help needed

Thanks. I have tried the same. And end up in same results,

But if I decrypt buffers (sizes of 4352, 2048, 1024) in the same sequence as that of encryption. It is giving proper output. ( it is matching with the original buffer).

What could be the reason?

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, September 07, 2004 1:56 PM
To: [EMAIL PROTECTED]
Subject: Re: 3 des implementation - help needed

 

Try

 

p.s. out must be allocated char[(i_len+(8-i_len%8))]

BOOL SSL_encrypt_key(EVP_CIPHER_CTX ctx, char *in, char *out, int i_len,int *o_len ){

    int o_final_len;

            EVP_EncryptUpdate(&ctx,out, o_len, in, i_len);

            EVP_EncryptFinal(&ctx,out+*o_len, &o_final_len);

            *o_len+=o_final_len;

            return SUCCESS;

 

}

 

BOOL SSL_decrypt_key(EVP_CIPHER_CTX ctx,char *in, char *out,

                                                int i_len,int *o_len){

          int o_final_len;

            EVP_DecryptUpdate(&ctx,out, o_len, in, i_len);

            EVP_DecryptFinal(&ctx,out+*o_len, &o_final_len);

            *o_len+=o_final_len;

            return SUCCESS;

}

 

Francesco Petruzzi

 

 

--------
The information contained in this electronic message and any attachments (the "Message") is intended for one or more specific individuals or entities, and may be confidential, proprietary, privileged or otherwise protected by law. If you are not the intended recipient, please notify the sender immediately, delete this Message and do not disclose, distribute, or copy it to any third party or otherwise use this Message. Electronic messages are not secure or error free and can contain viruses or may be delayed, and the sender is not liable for any of these occurrences. The sender reserves the right to monitor, record and retain electronic messages.
--------
Le informazioni contenute in questo messaggio e gli eventuali allegati (il "Messaggio") si intendono inviate a uno o piú specifici destinatari. Il contenuto del Messaggio puó essere confidenziale, riservato e comunque protetto dalla legge applicabile. Se non siete i destinatari del Messaggio, siete pregati di informare immediatamente il mittente, cancellare questo Messaggio, non rivelarlo, non distribuirlo ne' inoltrarlo a terzi, non copiarlo né farne alcun uso. I messaggi di posta elettronica non sono sicuri e sono soggetti ad alterazioni, possono essere trasmettitori di Virus informatici o soggetti a ritardi nella distribuzione. Il mittente del Messaggio non puó essere in alcun modo considerato responsabile per queste evenienze. Il mittente si riserva il diritto di archiviare, ritenere e controllare i messaggi di posta elettronica.

----- Original Message -----

Sent: Tuesday, September 07, 2004 9:29 AM

Subject: 3 des implementation - help needed

 

Hi.,

  I am planning to use 3 des implementation.  I am encrypting the chunk of data (1024/2048/4352 bytes) with randomly generated keys and vectors. I have stored the keys and vectors in non volatile memory or a file. During decryption I have taken the key and vector from the file or non volatile memory. The first 8 bytes are overwritten. Means the decrypted data is not matching!!!

In this case I am having two applications which are running independently. I have used EVP_des_ede3_cfb() – cipher for encryption.

I would like to know that apart from key and vector used for encryption do I need to store something else also for decryption?

P.S: If I have a sample application in which decryption and encryption are not done, in that case Unencrypted data is matching with the original one!!

Thanks.,

Sakthi S G

 

Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments.

 

Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments.

Reply via email to