Greetings,
I'm attempting to test compatibility between Crypto++ 4.2 and OpenSSL 0.9.6g, both 
under Win2k.  I would like to  exchange keys (and the encrypted data) between the two.

>From Crypto++, I create a DES EDE3 (CBC mode) key using the following:
        ...     
        DES_EDE3_Encryption en(key);
        CBC_CTS_Encryptor encryptor(en, iv);
        ....
        then write the key to file using:
        memcpy(&keyStruct->key_iv[0], key, DES_EDE3_KEYSIZE);
        memcpy(&keyStruct->key_iv[(int)DES_EDE3_KEYSIZE], iv, 
DES_EDE3_Encryption::BLOCKSIZE);
        FileSink fs1(payloadFileName);
        fs1.Put((const byte *) &keyResult->key_iv [0], sizeof(keyResult->key_iv));

I am able to encrypt and decrypt messages  successfully within Crypto++ with the 
resulting file.

Problem is when using OpenSSL to encrypt messages using the key from Crypto++.

>From OpenSSL  (the Crypto++ key is in file "crypto_des", plaintext is in 
>"smalltext.txt", ciphertext to "des_ssl") : 

> openssl enc -in smalltext.txt -e -kfile crypto_des -out des_ssl -des-ede3-cbc  
> -nosalt

No success in decrypting the result (in des_ssl )  within Crypto++.

I am sure this must be a problem with OpenSSL or my usage of it. But has anyone else 
tried this?


Regards.
D Atkins


Reply via email to