We would like to convert our use of mcrypt to openssl.
Here is our encryption function:
mcrypt_ecb(MCRYPT_3DES,$key,$payload,MCRYPT_ENCRYPT)
Here is our decryption function:
mcrypt_ecb(MCRYPT_3DES,$key,$payload,MCRYPT_DECRYPT)
What are the openssl_* equivalents of the above?
Thanks.
I think you're looking for the
EVP_Encrypt...
functions withEVP_des_ede3
as the cipher (although you should really be using CBC mode rather than ECB).https://www.openssl.org/docs/crypto/EVP_EncryptInit.html#
If it helps, I have a short example for AES written in C++ at https://github.com/shanet/Crypto-Example. Converting it to use triple DES should be trivial.