Simplest two-way encryption using PHP

前端 未结 6 1648
半阙折子戏
半阙折子戏 2020-11-22 07:11

What is the simplest way of doing two way encryption in common PHP installs?

I need to be able to encrypt data with a string key, and use the same key to decrypt on

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 07:27

    Edited:

    You should really be using openssl_encrypt() & openssl_decrypt()

    As Scott says, Mcrypt is not a good idea as it has not been updated since 2007.

    There is even an RFC to remove Mcrypt from PHP - https://wiki.php.net/rfc/mcrypt-viking-funeral

提交回复
热议问题