Interoperation with OpenSSL
Stephan <[email protected]>
| Newsgroups | gmane.comp.encryption.cryptlib |
|---|---|
| Message-ID | <[email protected]> |
Hello list,
I'm using Cryptlib along with OpenSSL and have begun interop
testing. Is it reasonable to expect Cryptlib and OpenSSL to be
interchangable when de/encrypting with one and the other tool?
Premises:
C Cleartext data contents '1234'
E1 Cryptlib AES Encryption algorithm
E2 OpenSSL AES Encryption algorithm
D1 Cryptlib AES Decryption algorithm
D2 OpenSSL AES Decryption algorithm
Observations:
Both E1(C) and E2(C) produce encrypted data as expected
Both D1(E1(C)) and D2(E2(C)) equate to C as expected
Errors:
D2(E1(C)) OpenSSL fails with the error 'bad magic number'
D1(E2(C)) cryptPushData(...) fails with CRYPT_ERROR_BADDATA
Notes:
The OpenSSL commands are:
openssl enc -e -salt -aes256 -in 1234_clear.dat -out 1234_encr.dat
openssl enc -d -salt -aes256 -in 1234_encr.dat -out 1234_test.dat
diff -bd 1234_clear.dat 1234_test.dat
Cryptlib is used in a similar way to the 'Code examples' of the
website. The actual commands look like this:
cryptest -e -p thispass1 -i 1234_clear.dat -o 1234_encr.dat
cryptest -d -p thispass1 -i 1234_encr.dat -o 1234_test.dat
diff -bd 1234_clear.dat 1234_test.dat
I've tried several versions of OpenSSL up until 0.9.8i.
The Cryptlib version is 3.3.3 from ftp://ftp.franken.de/pub/crypt/
with no special bindings. The source for 'cryptest' is ISO C++
compiled with GCC 4.0.1.
I'm using the same static password for all operations, no
certificates, contexts, or signatures are used.
To encrypt with AES, 'cryptest' has:
cryptSetAttribute(CRYPT_UNUSED, CRYPT_OPTION_ENCR_ALGO, CRYPT_ALGO_AES);
cryptSetAttribute(CRYPT_UNUSED, CRYPT_OPTION_ENCR_HASH, CRYPT_ALGO_SHA1);
cryptSetAttribute(CRYPT_UNUSED, CRYPT_OPTION_ENCR_MAC, CRYPT_ALGO_HMAC_SHA1);
Regards,
Stephan
_______________________________________________
Cryptlib mailing list
[email protected] via Mail: [email protected]
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.