AES encrypt with openssl decrypt using java

后端 未结 1 1358
半阙折子戏
半阙折子戏 2020-12-15 10:51

I have to encrypt an xml file using openssl command line or a C api. The output shall be Base64.

A java programm will be used for decrypting. This programm is provid

相关标签:
1条回答
  • 2020-12-15 11:32

    Java's SecretKeySpec uses the password ASCII bytes directly as key bytes, while OpenSSL's -pass pass:... method derives a key from the password using a key derivation function to transform the password into a key in a secure fashion. You can either try to do the same key derivation in Java (which you probably cannot if I interpret your question correctly), or use OpenSSL's -K option to pass in a key (as hex bytes!) instead of a password.

    You can find out how there.

    0 讨论(0)
提交回复
热议问题