Hello

I have some question about compatibility between java crypto and openssl
library.

This is my case:
1.I created DESede key and stored it to file:
{code}
SecretKey key = KeyGenerator.getInstance("TripleDES").generateKey();
File f = new File("c:\\key.dat");
DataOutputStream dos =new DataOutputStream(new FileOutputStream(f));
dos.write(key.getEncoded());
dos.close();
{code}

2.I encrypt some file "c:\\normal.dat" through:
{code}
ecipher.init(Cipher.ENCRYPT_MODE, key);
  byte[] enc = ecipher.doFinal(normalData);//normalData- loaded file
  File f2 = new File("c:\\enc.dat");
  DataOutputStream dos2 =new DataOutputStream(new FileOutputStream(f2));
  dos2.write(enc);
  dos2.close();
{code}

3.I encrypted normal data file in openssl through:
openssl.exe enc -des3 -in c:\normal.dat -out c:\enc2.dat -pass
file:c:\key.dat -nosalt

I tried other algoritm too as(des-ede,des-ede3..) but I got not equal files
as enc.dat and enc2.dat. 
I used same key in both cases.

Does exist some compatibility between encryption algorithms in java and
openssl or not? I'm interested especially in tripledes.

These functionality(encryption,decryption) will be used by any applications
developmented in C++, JAVA and VB. I need some compatibilited  des3
algorithm.

Can somebody help me ?

Thanks






-- 
View this message in context: 
http://www.nabble.com/Compatibility-between-Java-crypto-and-open-ssl-tf4611666.html#a13169808
Sent from the OpenSSL - User mailing list archive at Nabble.com.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to