Hello Everyone,

Has anyone had any experience using DES Decryption routines to decrypt a 16 byte
ciphertext into the original using an IV??

I am receiving the IV and the Encrypted Data from a server that is using the MS Crypto
API for des encryption and decryption.  The mode is CBC (Cipher Block Chaining).  I 
have
to now decrypt this encrypted data (16 bytes) using the IV (8 bytes).  However, after I
decrypt, I am getting the wrong data.

Please see a snip of the code below and let me know if you've come across anything
similar or could help me at all.  It would be tremendously appreciated.

>>>>>>>SNIP>>>>>>>>>>
       des_key_schedule *ks = NULL;

        if(!input || !output || !inputLen || !iv)
                return -1;

        ks      =       getSessionKey();

        /* InputLen is 16 */
        if(ks != NULL)
        {
                des_ncbc_encrypt(input, output, inputLen, *ks, iv, DES_DECRYPT);
                dumpall ("DECRYPTOUTPUT", output, (strlen ((char *) output)));
                fprintf (stderr, "\nOUTPUT in HEX: \n");
                dump (output, inputLen);
                fprintf (stderr, "\nIV in HEX: \n");
                dump (*iv, 8);
        }
        else
                return -2;

<<<<<<<SNIP<<<<<<<<<<<<<<<

Any assistance or feedback will be greatly appreciated.  Thanks a lot in advance!!,

Regards,
 J..




__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to