在PHP 7中使用salt进行最佳加密/解密

Att*_*ghi 0 php encryption

我正在寻找最简单和安全的方法来加密/解密PHP7中特定盐的字符串

my string + specific salt = encryped data 
decode(encryped data) = my string
Run Code Online (Sandbox Code Playgroud)

我看到了这篇文章,但mcrypt_encrypt似乎已被弃用了.你有其他建议或例子吗?谢谢

nah*_*hds 6

OpenSSL功能是一个很好的方法.官方文件:

希望能帮助到你!

  • 英文:https://php.net/manual/en/function.openssl-encrypt.php https://php.net/manual/en/function.openssl-decrypt.php (2认同)