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.
精彩评论