本文目录一览:
源码如何解密PHP
解密后的代码如下:
$fp=fopen(__FILE__,'rb');
fread($fp,1260);
$OO00O00O0=(base64_decode(strstr( fread($fp,380)
,'BgqGbi8/ck0Yw+fDjA15VnoPrMWzysXKea4pZudNI7UH9TEQvtSlJx3Rhm2COFL6='
,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')));
eval($OO00O00O0);
即取该文件?后的字符进行base64_decode后作php脚本再执行
php版本不支持strstr的参数个数为三个的,自己继续研究吧
php如何解密zend??我把源码贴上来了~
你这个不是zend加密的,是ioncube加密的,所以用我的黑刀dezender肯定是解密不出来的了。呵呵。关于ioncube的解密目前国外有个朋友正在研究,但貌似我测试过很多ioncube加密的文件还是解密不出来的。耐心等待吧。呵呵。
欢迎访问我的网站
PHP代码解密
xmp
第1次解密结果如下:(虚线为分隔符)
-------------------------
?
?php
eval(gzinflate(base64_decode('NdJJsppAAADQvafI7mu5QFpAqJ/EYhIZBBqZNylaGgQJ8yCePqu8M7zz783Pc/tsN3hOqm3+KeqsSka8RcmAGepPih9NirdfZnoxXp268LwE5yRrwmA21eF5bYKEMTI652UPIil1db4SIa+JvkwR3bEKsTbPIGbNOZXjqHpxBoPWchoHaJsG9+J7Nthb/V9g0S0n9HUdkjXouqeySkbKkREV2JrjUVVyiX2dzLVWv54mpXNsmN0PuJIdyoL5oRTYj6zbYChOXLqsZeNqvQfQ4+ZgXZoK4WhyoDAOw5FBGjGs6bqProxlYbQXV/Z21CxIt+qQADDMxX3FAE+U7GOYCWMdz0SS0PHRWKxWXGL4YkSqHNyl8Y1sDsLy+pBHwep80K6eIl728GqqLpkevO7dwVgzLb5yh9o4nNLRt+QSR96HVBbn+SCnUQKF518S4dayjO0B1e7wO7Kmz4e9wyJ9h5UQUkieda9ooBYhOlfKvJ2V9MGqfTna9VpIZCMbYEHVmIgYIRRQCm03ZNjGrKN1LfnkEC259DvrBWKAUllKLGH3TCguwQwwItZXRiz8r6/dbve9Of+P8OMf')));
?
?php
-----------------------------
解密方法为:
把开始部分的:“eval(”和 “);” 之间的内容COPY下来,
做成:
$a= gzinflate(base64_decode('NdJHjp ………… EX'));
printf("xmp\n第1次解密:\n%s\n/xmp\n",$a);
这样就出结果了,下面的一样处理,到第5次就得到了HTML了
/xmp
xmp
第2次解密结果如下:(虚线为分隔符)
-------------------------
?
?php
eval(gzinflate(base64_decode('NdFLkqIwAADQvafoXWvNIshHoWa6Lf5gAEUQbDdTKAlCQAJCVE4/q3lXeJvv2Z8NvdEZYlk9L6byjutsQPNL9kAr8W+Orm2O5p9BrnnX1n2qqhGyDLd91Y4WPJRU4laFZVK1gJpKH7uGqRPQfS0elER4OQg0jB8zEKP2si79dwyjoTJrU2bcMReKDuiB3N92iL0s36bJ/sydy+YH6OOeb+Cy8M3JOQ5pIsa22sviSye2eu4EVeQfBtnZv/aa5Z3LwOpCwZQk6C4jsTwoVLfvWXjHcEtBOqV2pyUGCF+QHNIT1d0UqxqQZJNOAlTsnL07dtVOEjeYUz1GwRhc1utD2iUVFaBMp86PU2IPqexYOuzz8SQidxXlBX4bEvKUioQJYb5gGjgpvGdc8IrjtPnyiD1oEL2wbltaCebbbW4G5Po1XpZ8RJqp1h9b5DT5xfrB/sQDjjD8/Pr6XCwWv2eb/ykf/wA=')));
?
?php
---------------------------
/xmp
xmp
第3次解密结果如下:(虚线为分隔符)
-------------------------
?
?php
eval(gzinflate(base64_decode('NdBLcoIwAADQvaforjouFKRip506gFEpAgKBApsOmvAz/CMBTt9V3xHe/mv2ua/Teob7iMyTKStjElE8v0Ud3gq/CN8rhOevxFMGpVPZ0ZimY/CuP2mK1gMEzHUtWV4TGAr84xCkGAZq3A42sDkOG+PBFLZiNFqQ3E55KI1S4iR9pCGnaQnfKJp/WzWGqBVD/QxKkRWXpCIWfAB/58Epz3K9GdvyqvcBX50tEzluSNuNb77RWqVjp3K8pzqMTWkGtW8HFCKrduX4eI6SdgfyD5eL9jkQVkvM3EDfVgLwTg29HHod1UfLKDkCgFhJpj3EyImhDK0r7f1i2SkmzlCsJeHmdbFYfMz2/0kvfw==')));
?
?php
------------------------
/xmp
xmp
第4次解密结果如下:(虚线为分隔符)
-------------------------
?
?php
eval(gzinflate(base64_decode('lVCxCsIwFNzzFY9Muthd0xTEwUUQBB0lTZ42kDYheTYIfrxRER11eNyDO467ayQTlbGjZAyAgSgvaKdSqrl2qCKXb/qN7KmxpuYn7wmLgolQTkEX8VTzjijMqyrnPMvY2oHQOdSUZtr3XO5tpItysI12VISwwzhiTKJSEm7wo8nykuyAKcEBW1j7RHY4/+ewUYM6o4EVGqtLDvMdpFQNn1lEE7oAORxfdSfTBTQPtvXm+sCOeidfKgZ3')));
?
?php
----------------------
/xmp
xmp
第5次解密结果如下:(虚线为分隔符)终于看到HTML了
-------------------------
?
/div
div class="clear"/div
/div
div id="footer"
p
a href=""Virtual Private Servers/a | a href=""Business Web Hosting/a | a href=""Managed Dedicated Servers/a
/p
/div
?php wp_footer(); ?
/body
/html
?php
---------------------------
/xmp
请教php源码加密及解密问题
base64 可加可解。 md5 不可解
2种PHP的源码加密方式,此加密方法支持任意PHP版。
注意,加密后的PHP代码无需第三方工具解密,像往常一样,直接运行即可。
复制代码 代码如下:
?php
function encode_file_contents($filename) {$type=strtolower(substr(strrchr($filename,'.'),1));if ('php' == $type is_file($filename) is_writable($filename)) { // 如果是PHP文件 并且可写 则进行压缩编码$contents = file_get_contents($filename); // 判断文件是否已经被编码处理$contents = php_strip_whitespace($filename);// 去除PHP头部和尾部标识
$headerPos = strpos($contents,'?php');
$footerPos = strrpos($contents,'?');
$contents = substr($contents, $headerPos + 5, $footerPos - $headerPos);$encode = base64_encode(gzdeflate($contents)); // 开始编码$encode = '?php'."\n eval(gzinflate(base64_decode("."'".$encode."'".")));\n\n?";return file_put_contents($filename, $encode);}
return false;
}
//调用函数
$filename = 'dam.php';
encode_file_contents($filename);
echo "OK,加密完成!"
?
加密方式2:
复制代码 代码如下:
?php
function RandAbc($length = "") { // 返回随机字符串$str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";return str_shuffle($str);
}
$filename = 'index.php'; //要加密的文件
$T_k1 = RandAbc(); //随机密匙1
$T_k2 = RandAbc(); //随机密匙2
$vstr = file_get_contents($filename);
$v1 = base64_encode($vstr);
$c = strtr($v1, $T_k1, $T_k2); //根据密匙替换对应字符。
$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;
// 生成 加密后的PHP文件
$fpp1 = fopen('temp_'.$filename, 'w');
fwrite($fpp1, $s) or die('写文件错误');
?
其实,PHP加密源码方式有很多,譬如,免费的微盾PHP加密,还有 搞的在线加密,只是phpjm更复杂点而已。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++另外,分享一个 PHP类,它能对 文本的内容进行 二进制加密 与 解密,代码如下:
复制代码 代码如下:
?php
class text_auth
{
var $n_iter;
function text_auth()
{
$this-setIter(32);
}
function setIter($n_iter)
{
$this-n_iter = $n_iter;
}
function getIter()
{
return $this-n_iter;
}
function encrypt($data, $key)
{
$n = $this-_resize($data, 4);
$data_long[0] = $n;
$n_data_long = $this-_str2long(1, $data, $data_long);$n = count($data_long);
if (($n 1) == 1) {
$data_long[$n] = chr(0);
$n_data_long++;
}
$this-_resize($key, 16, true);
if ( '' == $key )
$key = '0000000000000000';
$n_key_long = $this-_str2long(0, $key, $key_long);$enc_data = '';
$w = array(0, 0);
$j = 0;
$k = array(0, 0, 0, 0);
for ($i = 0; $i $n_data_long; ++$i) {
if ($j + 4 = $n_key_long) {
$k[0] = $key_long[$j];
$k[1] = $key_long[$j + 1];
$k[2] = $key_long[$j + 2];
$k[3] = $key_long[$j + 3];
} else {
$k[0] = $key_long[$j % $n_key_long];
$k[1] = $key_long[($j + 1) % $n_key_long];$k[2] = $key_long[($j + 2) % $n_key_long];$k[3] = $key_long[($j + 3) % $n_key_long];}
$j = ($j + 4) % $n_key_long;
$this-_encipherLong($data_long[$i], $data_long[++$i], $w, $k);$enc_data .= $this-_long2str($w[0]);
$enc_data .= $this-_long2str($w[1]);
}
return $enc_data;
}
function decrypt($enc_data, $key)
{
$n_enc_data_long = $this-_str2long(0, $enc_data, $enc_data_long);$this-_resize($key, 16, true);
if ( '' == $key )
$key = '0000000000000000';
$n_key_long = $this-_str2long(0, $key, $key_long);$data = '';
$w = array(0, 0);
$j = 0;
$len = 0;
$k = array(0, 0, 0, 0);
$pos = 0;
for ($i = 0; $i $n_enc_data_long; $i += 2) {if ($j + 4 = $n_key_long) {
$k[0] = $key_long[$j];
$k[1] = $key_long[$j + 1];
$k[2] = $key_long[$j + 2];
$k[3] = $key_long[$j + 3];
} else {
$k[0] = $key_long[$j % $n_key_long];
$k[1] = $key_long[($j + 1) % $n_key_long];$k[2] = $key_long[($j + 2) % $n_key_long];$k[3] = $key_long[($j + 3) % $n_key_long];}
$j = ($j + 4) % $n_key_long;
$this-_decipherLong($enc_data_long[$i], $enc_data_long[$i + 1], $w, $k);if (0 == $i) {
$len = $w[0];
if (4 = $len) {
$data .= $this-_long2str($w[1]);
} else {
$data .= substr($this-_long2str($w[1]), 0, $len % 4);}
} else {
$pos = ($i - 1) * 4;
if ($pos + 4 = $len) {
$data .= $this-_long2str($w[0]);
if ($pos + 8 = $len) {
$data .= $this-_long2str($w[1]);
} elseif ($pos + 4 $len) {
$data .= substr($this-_long2str($w[1]), 0, $len % 4);}
} else {
$data .= substr($this-_long2str($w[0]), 0, $len % 4);}
}
}
return $data;
}
function _encipherLong($y, $z, $w, $k)
{
$sum = (integer) 0;
$delta = 0x9E3779B9;
$n = (integer) $this-n_iter;
while ($n-- 0) {
$y = $this-_add($y,
$this-_add($z 4 ^ $this-_rshift($z, 5), $z) ^$this-_add($sum, $k[$sum 3]));
$sum = $this-_add($sum, $delta);
$z = $this-_add($z,
$this-_add($y 4 ^ $this-_rshift($y, 5), $y) ^$this-_add($sum, $k[$this-_rshift($sum, 11) 3]));}
$w[0] = $y;
$w[1] = $z;
}
function _decipherLong($y, $z, $w, $k)
{
$sum = 0xC6EF3720;
$delta = 0x9E3779B9;
$n = (integer) $this-n_iter;
while ($n-- 0) {
$z = $this-_add($z,
-($this-_add($y 4 ^ $this-_rshift($y, 5), $y) ^$this-_add($sum, $k[$this-_rshift($sum, 11) 3])));$sum = $this-_add($sum, -$delta);
$y = $this-_add($y,
-($this-_add($z 4 ^ $this-_rshift($z, 5), $z) ^$this-_add($sum, $k[$sum 3])));
}
$w[0] = $y;
$w[1] = $z;
}
function _resize($data, $size, $nonull = false){
$n = strlen($data);
$nmod = $n % $size;
if ( 0 == $nmod )
$nmod = $size;
if ($nmod 0) {
if ($nonull) {
for ($i = $n; $i $n - $nmod + $size; ++$i) {$data[$i] = $data[$i % $n];
}
} else {
for ($i = $n; $i $n - $nmod + $size; ++$i) {$data[$i] = chr(0);
}
}
}
return $n;
}
function _hex2bin($str)
{
$len = strlen($str);
return pack('H' . $len, $str);
}
function _str2long($start, $data, $data_long){
$n = strlen($data);
$tmp = unpack('N*', $data);
$j = $start;
foreach ($tmp as $value)
$data_long[$j++] = $value;
return $j;
}
function _long2str($l)
{
return pack('N', $l);
}
function _rshift($integer, $n)
{
if (0xffffffff $integer || -0xffffffff $integer) {$integer = fmod($integer, 0xffffffff + 1);}
if (0x7fffffff $integer) {
$integer -= 0xffffffff + 1.0;
} elseif (-0x80000000 $integer) {
$integer += 0xffffffff + 1.0;
}
if (0 $integer) {
$integer = 0x7fffffff;
$integer = $n;
$integer |= 1 (31 - $n);
} else {
$integer = $n;
}
return $integer;
}
function _add($i1, $i2)
{
$result = 0.0;
foreach (func_get_args() as $value) {
if (0.0 $value) {
$value -= 1.0 + 0xffffffff;
}
$result += $value;
}
if (0xffffffff $result || -0xffffffff $result) {$result = fmod($result, 0xffffffff + 1);
}
if (0x7fffffff $result) {
$result -= 0xffffffff + 1.0;
} elseif (-0x80000000 $result) {
$result += 0xffffffff + 1.0;
}
return $result;
}
}
?
使用方法参考如下:
// 加密过程
view sourceprint?
$text_file = S_ROOT . './456.php';
$str = @file_get_contents($text_file);
require_once S_ROOT . "./text_auth.php";
$text_auth = new text_auth(64);
$str = $text_auth-encrypt($str, "qianyunlai.com");$filename = S_ROOT . './789.php'; // 加密后的文本为二进制,普通的文本编辑器无法正常查看file_put_contents($filename, $str);
// 解密过程
view sourceprint
?01 $text_file = S_ROOT . './789.php';
$str = @file_get_contents($text_file);
require_once S_ROOT . "./text_auth.php";
$text_auth = new text_auth(64);
$str = $text_auth-decrypt($str, "qianyunlai.com");$filename = S_ROOT . './456.php';
file_put_contents($filename, $str);
PHP如何实现AES加解密
AES(The Advanced Encryption Standard)是美国国家标准与技术研究所用于加密电子数据的规范。它被预期能成为人们公认的加密包括金融、电信和政府数字信息的方法。本文展示了AES的概貌并解析了它使用的算法。包括一个完整的C#实现和加密.NET数据的举例。在读完本文后你将能用AES加密、测试 基于AES的软件并能在你的系统中使用AES加密。
sg11解密为啥那么贵
通用性高。个别模块有加密的文件,则需要安装解密扩展才能正常使用通常我们只需安装ionCube以及SG11解密扩展即可。sg11加密号称目前最安全的组件加密,而且解密包含了市面上遇到的大部分文件,通用性高所以贵。SG11其实是基于PHP扩展的一个加密组件。