当前位置:网站首页>Upgrade PHP to php7 The impact of X (2), the obsolescence of mcrypt decryption
Upgrade PHP to php7 The impact of X (2), the obsolescence of mcrypt decryption
2022-06-25 04:39:00 【zepcjsj0801】
For me who lacks theory , Copy and paste the following paragraph directly
Stick the code directly , This class is provided based on wechat official account message encryption and decryption PHP DEMO And to
php Of mcrypt Extensions are out of date about 10 year , And it is very complicated to use . So it was abandoned and OpenSSL replaced . from PHP 7.2 It will be removed from the core code and moved to PECL in .PHP Manual in 7.1 The migration page gives an alternative , Just use OpenSSL replace MCrypt.
The following content is modified from my own real weapon , The contrast is obvious .

The following is the original code
$decrypted = openssl_decrypt(base64_decode($packet['encrypt']), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv); /*
$ciphertext_dec = base64_decode($packet['encrypt']);
$module = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
$iv = substr($key, 0, 16);
mcrypt_generic_init($module, $key, $iv);
$decrypted = mdecrypt_generic($module, $ciphertext_dec);
mcrypt_generic_deinit($module);
mcrypt_module_close($module); */
边栏推荐
- Detailed explanation of flex attributes in flex layout
- 冰冰学习笔记:循环队列的实现
- Introduction to intstream API
- 彻底理解数据库事务
- CTF_ Web: Advanced questions of attack and defense world expert zone WP (15-18)
- php封装curl发送get、post请求方法,并使用
- UCLA | generative pre training for black box optimization
- 2021.6.14 notes
- 第二十五周记录
- Retrofit source code analysis
猜你喜欢

【esp32学习之路6——flash加密】

LabVIEW开发气体调节器

Simple text analysis of malicious samples - Introduction

Deep learning - several types of learning

Nodejs connects to MySQL through heidisql, and ER appears_ BAD_ DB_ ERROR: Unknown database 'my_ db_ books'

我的IC之旅——资深芯片设计验证工程师成长——“胡”说IC工程师完美进阶

UCLA | generative pre training for black box optimization

简单的恶意样本行文分析-入门篇

CTF_ Web:8-bit controllable character getshell

「 每日一练,快乐水题 」1108. IP 地址无效化
随机推荐
2.0springmvc uses restful
Retrofit 源码分析
Vscode 设置clang-format
Blob page in gbase 8s
CTF_ Web: advanced problem WP (5-8) of attack and defense world expert zone
《牛客刷verilog》Part I Verilog快速入门
坐标系左乘右乘
Thorough understanding of database transactions
EasyRecovery15非常好用的电脑数据恢复软件
JS call() and apply()
Office macro virus bounce shell experiment
mongodb集群
Classification of gbase 8s locks
2.0SpingMVC使用RESTful
华为鸿蒙开发第四课
Communication problems in parent and child components of uniapp
什么是持久化?redis 持久化中的RDB和AOF是什么?
GBASE 8s存儲過程語法結構
Concat() in JS
Xiaobai learns MySQL - Statistical 'opportunism'