Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OpenSSL and Java

 
Mazen Mahmoud
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to encrypt a serialized java file (test.ser) using OpenSSL. I've used the Runtime.getRuntime().exec function and i've passed to it the following string array : {"cmd.exe", "/c", "openssl smime -encrypt...."}
(it will create a new file : test1.ser)

everything works fine. then i've used the openssl to decrypt test1.ser. it will create new file (test2.ser). For some reasons, test2.ser is not similar to test.ser (which must not), and test2.ser cannot be used with FileInputStream and ObjectInputStream to be deserialized using the readObject function. (It will fail on the construction of ObjectInputStream).

Any help???
 
Joe Ess
Bartender
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
You may have better luck with an OpenSSL-oriented mailing list or forum. Try to solve using OpenSSL from the command line, then come back with java-specific concerns.
The Java API has a built-in crypto capability that may be easier to use within a Java program.
 
Mazen Mahmoud
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was able to solve it. The problem was in the openssl command...

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic