当前位置:网站首页>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); */
边栏推荐
- CTF_ Web: Advanced questions of attack and defense world expert zone WP (9-14)
- What is persistence? What are RDB and AOF in redis persistence?
- GBASE 8s的数据导入和导出
- sql_ mode=only_ full_ group_ By's pit
- CMD operation MySQL in Windows
- CTF_ Web: file contains pseudo protocol with PHP
- CTF_ Web: Advanced questions of attack and defense world expert zone WP (1-4)
- CTF_ Variable coverage in web:php
- 关于TCP连接三次握手的详细总结
- 515. 在每个树行中找最大值 / 剑指 Offer II 095. 最长公共子序列
猜你喜欢
CTF_ Web:8-bit controllable character getshell
JS' sort() function
i. Max development board learning record
Office macro virus bounce shell experiment
Gbase 8s overall architecture
GBASE 8s 索引B+树
领导:谁再用 Redis 过期监听实现关闭订单,立马滚蛋!
js的arguments
Easyrecovery15 very easy to use computer data recovery software
2.0SpingMVC使用RESTful
随机推荐
Value transfer between parent and child components of wechat applet
Immutable learning road -- farewell to traditional copy
Le chemin de l'apprentissage immutable - - Adieu à la copie traditionnelle
写shell脚本报错总结
领导:谁再用 Redis 过期监听实现关闭订单,立马滚蛋!
Gbase 8s overall architecture
[esp32 learning path 6 - Flash encryption]
SQL注入详解
Immutable学习之路----告别传统拷贝
halcon之区域:多种区域(Region)生成(3)
记录小知识点
Gbase 8s stored procedure flow control
机器学习深度学习——向量化
GBASE 8s 索引R树
Laravel document sorting 6. Response
我的IC之旅——资深芯片设计验证工程师成长——“胡”说IC工程师完美进阶
Deep learning - several types of learning
如何筛选出和产品相关的词,精准排除掉无效词
2021.8.29 notes: register, bit operation, pointer, structure
2020.3.3 notes async/await and promise and Then processes and threads