免费在线PHP加密、解密、混淆源代码工具

您所在的位置:网站首页 php混淆加密在线工具 免费在线PHP加密、解密、混淆源代码工具

免费在线PHP加密、解密、混淆源代码工具

2024-07-12 06:36| 来源: 网络整理| 查看: 265

  本文要推荐的[ToolFk]是一款程序员经常使用的线上免费测试工具箱,ToolFk 特色是专注于程序员日常的开发工具,不用安装任何软件,只要把内容贴上按一个执行按钮,就能获取到想要的内容结果。ToolFk还支持 BarCode条形码在线生成、 QueryList采集器、 PHP代码在线运行、 PHP混淆、加密、解密、 Python代码在线运行、JavaScript在线运行、YAML格式化工具、HTTP模拟查询工具、HTML在线工具箱、JavaScript在线工具箱、CSS在线工具箱、JSON在线工具箱、Unixtime时间戳转换、Base64/URL/Native2Ascii转换、CSV转换工具箱、XML在线工具箱、WebSocket在线工具、Markdown 在线工具箱、Htaccess2nginx 转换、进制在线转换、在线加密工具箱、在线伪原创工具、在线APK反编译、在线网页截图工具、在线随机密码生成、在线生成二维码Qrcode、在线Crontab表达式生成、在线短网址生成、在线计算器工具。等20多个日常程序员开发工具,算是一个非常全面的程序员工具箱网站。

網站名稱:ToolFk網站鏈結:www.toolfk.com/工具链接:www.toolfk.com/tool-conver…

代码教學

本代码[在线PHP加密、解密、混淆源代码工具]依赖于CSDN一位朋友的代码库,由于很久之前借鉴过来的。所以没记住他的博客链接。在此抱歉。实现的PHP代码如下

STEP 1

STEP 2

是依赖这个PHP类。使用时直接NEW 一个对象,调用它的方法就行了。再次感谢作者的免费提供。

class PhpEncode { function is_cli() { return php_sapi_name() == 'cli' ? 1 : 0; } function rstr() //Random String Function { $len = rand(3, 6); $chr = ''; for ($i = 1; $i q1.'=$'.$this->q6.'{3}.$'.$this->q6.'{6}.$'.$this->q6.'{33}.$'.$this->q6.'{30};$'.$this->q3.'=$'.$this->q6.'{33}.$'.$this->q6.'{10}.$' .$this->q6.'{24}.$'.$this->q6.'{10}.$'.$this->q6.'{24};$'.$this->q4.'=$'.$this->q3.'{0}.$'.$this->q6.'{18}.$'.$this->q6.'{3}.$'.$this->q3.'{0} .$'.$this->q3.'{1}.$'.$this->q6.'{24};$'.$this->q5.'=$'.$this->q6.'{7}.$'.$this->q6.'{13};$'.$this->q1.'.=$'.$this->q6.'{22}.$'.$this->q6.'{36} .$'.$this->q6.'{29}.$'.$this->q6.'{26}.$'.$this->q6.'{30}.$'.$this->q6.'{32}.$'.$this->q6.'{35}.$'.$this->q6.'{26}.$'.$this->q6.'{30}; eval($'.$this->q1.'("'.base64_encode('$'.$this->q2.'="'.$this->c.'"; eval(\'?>\'.$'.$this->q1.'($'.$this->q3.'($'.$this->q4.'($'.$this->q2.',$'.$this->q5.'*2),$'.$this->q4.'($'.$this->q2.',$'.$this->q5.',$'.$this->q5.'), $'.$this->q4.'($'.$this->q2.',0,$'.$this->q5.'))));').'"));?>'; return $this; } //创建加密文件 private function build($target){ //$this->encodes("./index.php"); //$this->model(); $fpp1 = fopen($target,'w'); fwrite($fpp1,$this->s) or die('写入是失败!'); fclose($fpp1); return $this; } //加密处理 连贯操作 public function encode($input){ //$file = "index.php"; //连贯操作其实就是利用函数处理完后返回自身 return $this->ciphertext($input)->model()->s; } //解密 public function decode($out){ //读取要解密的文件 try{ return @$this->decodeMode($out)->s; }catch (FatalThrowableError $e){ return "decode error"; } } //解密模板,得到解密后的文本 private function decodeMode($fpp1){ //以eval为标志 截取为数组,前半部分为密文中的替换掉的函数名,后半部分为密文 $m = explode('eval',$fpp1); //对系统函数的替换部分进行执行,得到系统变量 $varStr = substr($m[0],strpos($m[0],'$')); //执行后,后续就可以使用替换后的系统函数名 eval($varStr); //判断是否有密文 if(!isset($m[1])){ return $this; } //对密文进行截取 {$this->q4} substr $star = strripos($m[1],'('); $end = strpos($m[1],')'); $str = ${$this->q4}($m[1],$star,$end); //对密文解密 {$this->q1} base64_decode $str = ${$this->q1}($str); //截取出解密后的 核心密文 $evallen = strpos($str,'eval'); $str = substr($str,0,$evallen); //执行核心密文 使系统变量被赋予值 $O0O000 eval($str); //并不能将如下段封装,因为 ${$this->qn} 并不能在全文中起作用 $this->s = ${$this->q1}( ${$this->q3}( ${$this->q4}( ${$this->q2},${$this->q5}*2 ), ${$this->q4}( ${$this->q2},${$this->q5},${$this->q5} ), ${$this->q4}( ${$this->q2},0,${$this->q5} ) ) ); return $this; } //递归读取并创建目标目录结构 private function targetDir($target){ if(!empty($target) ) { if(!file_exists($target)){ mkdir($target,0777,true); }else{ chmod($target,0777); } } } //递归解密 对指定文件夹下的php文件解密 public function decodeDir($source,$target=""){ if(is_dir($source)){ $this->targetDir($target); $dir = opendir($source); while(false!=$file=readdir($dir)) { //列出所有文件并去掉'.'和'..' 此处用的实例为thinkphp框架,所以默认排除里Thinkphp目录,用户可以按照自己的需求设置 if($file!='.' && $file!='..' && $file !='ThinkPHP') { $path = $target.DIRECTORY_SEPARATOR.$file; $sourcePath = $source.DIRECTORY_SEPARATOR.$file; $this->decodeDir($sourcePath,$path); } } }else if(is_file($source)){ $extension=substr($source,strrpos($source,'.')+1); if(strtolower($extension)=='php'){ $this->decode($source,$target); }else{ //不是php的文件不处理 copy($source, $target); } //return; } } //递归加密 对指定文件夹下的php文件加密 public function encodeDir($source,$target){ if(is_dir($source)){ $this->targetDir($target); $dir = opendir($source); while(false!=$file=readdir($dir)) { //列出所有文件并去掉'.'和'..' if($file!='.' && $file!='..' && $file !='ThinkPHP') { $path = $target.DIRECTORY_SEPARATOR.$file; $sourcePath = $source.DIRECTORY_SEPARATOR.$file; $this->encodeDir($sourcePath,$path); } } }else if(is_file($source)){ $extension=substr($source,strrpos($source,'.')+1); if(strtolower($extension)=='php'){ $this->encode($source,$target); }else{ copy($source, $target); } } } }复制代码 值得一試的三個理由:

整合各種程序员开发中经常使用的开发测试工具。

简洁美观大气的网站页面

支持 在线格式化执行代码、APK在线反编译、在线高强度密码生成、在线网页截图 等二十多種工具服务

同时还推荐一下它的姐妹网 www.videofk.com 视频下载工具箱

本文链接:www.hihubs.com/article/360



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3