当前位置:网站首页>Several schemes of PHP code encryption
Several schemes of PHP code encryption
2022-06-24 08:39:00 【An unreliable programmer】
How to protect your PHP Code :
Code obfuscation + encryption
Actual encryption is not , The specific implementation idea is to put the code base64 encryption , Then on base64 String mapping for strings in ( Randomly generated dictionaries are confused ) then eval perform This kind of 100% can be cracked and restored
The representative code is as follows :
<?php
function RandAbc($length = "") {
// Returns a random string
$str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
return str_shuffle($str);
}
$filename = 'index.php'; // Files to be encrypted
$T_k1 = RandAbc(); // Random key 1
$T_k2 = RandAbc(); // Random key 2
$vstr = file_get_contents($filename);
$v1 = base64_encode($vstr);
$c = strtr($v1, $T_k1, $T_k2); // Replace the corresponding characters according to the key .
$c = $T_k1.$T_k2.$c;
$q1 = "O00O0O";
$q2 = "O0O000";
$q3 = "O0OO00";
$q4 = "OO0O00";
$q5 = "OO0000";
$q6 = "O00OO0";
$s = '$'.$q6.'=urldecode("%6E1%7A%62%2F%6D%615%5C%76%740%6928%2D%70%78%75%71%79%2A6%6C%72%6B%64%679%5F%65%68%63%73%77%6F4%2B%6637%6A");$'.$q1.'=$'.$q6.'{3}.$'.$q6.'{6}.$'.$q6.'{33}.$'.$q6.'{30};$'.$q3.'=$'.$q6.'{33}.$'.$q6.'{10}.$'.$q6.'{24}.$'.$q6.'{10}.$'.$q6.'{24};$'.$q4.'=$'.$q3.'{0}.$'.$q6.'{18}.$'.$q6.'{3}.$'.$q3.'{0}.$'.$q3.'{1}.$'.$q6.'{24};$'.$q5.'=$'.$q6.'{7}.$'.$q6.'{13};$'.$q1.'.=$'.$q6.'{22}.$'.$q6.'{36}.$'.$q6.'{29}.$'.$q6.'{26}.$'.$q6.'{30}.$'.$q6.'{32}.$'.$q6.'{35}.$'.$q6.'{26}.$'.$q6.'{30};eval($'.$q1.'("'.base64_encode('$'.$q2.'="'.$c.'";eval(\'?>\'.$'.$q1.'($'.$q3.'($'.$q4.'($'.$q2.',$'.$q5.'*2),$'.$q4.'($'.$q2.',$'.$q5.',$'.$q5.'),$'.$q4.'($'.$q2.',0,$'.$q5.'))));').'"));';
$s = '<?php '."\n".$s."\n".' ?>';
//echo $s;
// Generate Encrypted PHP file
$fpp1 = fopen('temp_'.$filename, 'w');
fwrite($fpp1, $s) or die(' Error writing file ');
?>
Confusing garbled characters
Code obfuscate variables and other things and 1 The principle is similar , Just change the string to ascii 127 To 255 There are also characters that non-human editors cannot understand , The result is that 100% can be cracked and restored , It's just a matter of time .
issue opcode
Do not distribute code , But the first PHP Code precompile , distribution opcode,PHP7 in the future opcache Deep integration PHP7 You can use this method to protect the source code in the future , But also opcode Decompile back Will also be cracked .
confusion + encryption + Write PHP Expand
confusion + encryption + Write PHP Expand , But as long as it is open source PHP Extensions will be cracked , Unless you write your own encryption algorithm , hold PHP Code encryption , Then take it yourself C Voice write extension closed source , Others don't know your encryption and cracking ideas , The possibility of being cracked is very small .
Swoole Compiler
swoole The one that came out , It's generated opcode Confuse encryption later , Then this one is awesome , It is very obvious to implement this zend The engine is unlikely to recognize the confusion after encryption opcode, So he actually needs to rewrite zend, So the matching zend The engine has to be changed . According to hantianfeng, there is no possibility of being cracked But I found a successful solution on the Internet , I haven't tried .
边栏推荐
- ZUCC_ Principles of compiling language and compilation_ Big job
- Take my brother to do the project. It's cold
- Permission model DAC ACL RBAC ABAC
- Cloudbase database migration scheme
- 【微服务~Nacos】Nacos服务提供者和服务消费者
- Tencent conference API - get rest API & webhook application docking information
- 05-ubuntu安装mysql8
- RCNN、Fast-RCNN、Faster-RCNN介绍
- JS to get the last element of the array
- AUTO PWN
猜你喜欢

Qt 中发送自定义事件

Pat 1157: school anniversary

LabVIEW finds prime numbers in an array of n elements

成为IEEE学生会员

ZUCC_编译语言原理与编译_实验06 07 语法分析 LL 分析
![[micro services ~nacos] Nacos service providers and service consumers](/img/b7/47ecd6979ccfeb270261681d6130be.png)
[micro services ~nacos] Nacos service providers and service consumers

RCNN、Fast-RCNN、Faster-RCNN介绍

新技术实战,一步步用Activity Results API封装权限申请库

2022 tea artist (intermediate) work license question bank and online simulation examination

Centos7安装jdk8以及mysql5.7以及Navicat连接虚拟机mysql的出错以及解决方法(附mysql下载出错解决办法)
随机推荐
App Startup
Glusterfs replacement failure brick
Three categories of financial assets under the new standards: AMC, fvoci and FVTPL
QT writing security video monitoring system 36 onvif continuous movement
2021-03-09 comp9021 class 7 Notes
Promise的使用场景
ZUCC_编译语言原理与编译_实验03 编译器入门
2021-03-04 comp9021 class 6 notes
数据平台简介
jwt(json web token)
Rust procedure macro simply imitates Lombok function
uniapp 热更新后台管理
"Adobe international certification" Photoshop software, about drawing tutorial?
Variable declaration and some special variables in shell
11-- longest substring without repeated characters
lombok 使用
Take my brother to do the project. It's cold
【微服务~Nacos】Nacos服务提供者和服务消费者
AUTO PWN
[graduation season] Hello stranger, this is a pink letter