开发者

not-yet-commons SSL and Open SSL, Java and C++, Common Ground?

The not-yet-commons SLL package for Java provides an OpenSSL object with a method for password based encryption:

encrypt("des", password, data);

This method is said to be compatible with the OpenSSL C library. My question is, what is the OpenSSL C++ met开发者_运维问答hod equivalent to the above Java?

Thanks


Not-Yet-Commons-OpenSSL's ciphers are compatible with "openssl enc" command. Your example can be decrypted by this command,

  openssl enc -k password -a -d -des -in data.file

You can copy the code from the source,

http://cvs.openssl.org/fileview?f=openssl/apps/enc.c&v=1.45.2.5


The EVP cipher functions look like the closest parallel.


OpenSSL.encrypt() produces base64 output by default. Use OpenSSL.encrypt(alg, pwd, data, false) to turn that off.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜