当前位置:网站首页>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); */
边栏推荐
- 515. find the maximum value / Sword finger offer II 095 in each tree row Longest common subsequence
- JS arrow function
- 彻底理解数据库事务
- 深度学习——几种学习类型
- 2021.4.15 note the difference between let, const and VaR in ES6
- 单元测试覆盖率
- Paper notes: multi label learning ESMC (I don't understand it, but I haven't written it yet, so I'll put it here for a place temporarily)
- Synchronous and asynchronous functions (callback function, promise, generator, async/await)
- GBASE 8s存储过程流程控制
- Gbase 8s overall architecture
猜你喜欢

CTF_ Web: Advanced questions of attack and defense world expert zone WP (1-4)

Anaconda安装+TensorFlow安装+Keras安装+numpy安装(包含镜像和版本信息兼容问题)

CTF_ Web: advanced problem WP (5-8) of attack and defense world expert zone

Unity Quad culls shaders with back faces and transparent parts

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

Record small knowledge points

Vscode 设置clang-format

单元测试覆盖率

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

CTF_ Web:8-bit controllable character getshell
随机推荐
Concat() in JS
Doubts about judging the tinyint field type of MySQL
2021.8.29 notes: register, bit operation, pointer, structure
Unit test coverage
CTF_ Web: basic 12 questions WP of attack and defense world novice zone
OOP栈类模板(模板+DS)
JS call() and apply()
mongodb集群
Blob page in gbase 8s
Immutable学习之路----告别传统拷贝
CTF_ Web:php weak type bypass and MD5 collision
CTF_ Variable coverage in web:php
什么是存储引擎以及MySQL常见的三种数据库存储引擎
单元测试覆盖率
Laravel document sorting 6. Response
JS arrow function
Gbase 8s index b+ tree
CTF_ Web: Advanced questions of attack and defense world expert zone WP (19-21)
为什么TCP握手刚刚好是3次呢?
Laravel document sorting 8. Middleware