在PHP 7.1中使用Triple DES(3DES) [英] Using Triple DES(3DES) with PHP 7.1

查看:583
本文介绍了在PHP 7.1中使用Triple DES(3DES)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种使用3des进行加密和解密的方法。我当前正在使用php 7.1

I need a way to encrypt and decrypt with 3des. I'm currently using php 7.1

我发现这个问题,但mcrypt已已弃用自php 7.1起,我找不到任何其他资源。

I found this question, but mcrypt is deprecated as of php 7.1 and I can't find any other resource for this.

推荐答案

继续执行功能手册的注释部分,您将看到以下内容:

Continue to the Comments section of the function's manual and you'll see the following:


如果要在2015年编写代码对数据进行加密/加密,则应使用
openssl_encrypt()和openssl_decrypt()。基础库
(libmcrypt)自2007年以来已被废弃,其性能远不如
OpenSSL(后者在现代处理器上利用AES-NI且
缓存定时安全)。
[链接到完整评论]

因此,请考虑使用 openssl_encrypt() & openssl_decrypt()代替。
他们仍然受到支持并表现更好。

So, Consider using openssl_encrypt() & openssl_decrypt() instead. They are still being supported and better performing.

这篇关于在PHP 7.1中使用Triple DES(3DES)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆