Java equivalent of C++ encryption [duplicate]

The trickiest part of this is the EVP_BytesToKey part, which has been recreated before.

How to decrypt file in Java encrypted with openssl command using AES?

I’ve also got an object oriented version laying around here, if you are really not up to using that C-like code. For SHA-1, use SHA-1 instead of MD5…

As for the encryption, simply use "DESede/CBC/PKCS5Padding" as algorithm name for your Cipher.getInstance() method and you should be fine.

Leave a Comment