2010年04月26日   WordPress, 头条   8,198 次浏览

最近看到许多WordPress主题都被加密了,下面我来讲讲加密解密到底是怎么一回事。

有时候我们会在PHP文件中看到这样一些程序:

eval(base64_decode('VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='));

其实这就是一段被加密过的代码,大家千万不要被这些类似乱码的东西吓到了。

只要懂一些编程知识的人都知道,其实代码中的“base64_decode”就是一个解密的函数。
我们来新建一个PHP文件,内容如下:

<?php
$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==';
echo base64_decode($str);
?>

把这个文件传到PHP服务器上并打开,我们就可以看到原文了:

This is an encoded string

怎么样?是不是很简单呀,不管再怎么长的被加密过的代码,只是复制到上面那个PHP文件中就可以看到原文了。

下面我再来说说是怎么加密的,让大家彻底弄清里面的原理:
同样的,我们需要新建一个PHP文件,内容如下:

<?php
echo base64_encode("This is an encoded string");
?>

再在PHP服务器上打开这个文件,效果如下:

VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==

怎么样,是不是又看了之前那段加密的文字。是的,没错,加密就是通过“base64_encode”这个函数来实现的。

再说一点,可能大家碰到的加密函数不一定是这个,但是所用到的方法和原理是一样的,只要认真找就一定会找到方法的。

PS:尽管再这里教大家怎么破解加密了,但是大家还是要尊重版权,使用别人的东西一定要注明出处。

赞 赏
申明:除非注明,本站文章均为原创,转载请以链接形式标明本文地址。 如有问题,请于一周内与本站联系,本站将在第一时间对相关内容进行处理。
本文地址: http://www.yyjjssnn.cn/articles/426.html
相关阅读: WordPress, 加密解密

>>> Hello World <<<

这篇内容是否帮助到你了呢?

如果你有任何疑问或有建议留给其他朋友,都可以给我留言。

目前有有一条留言:

  • 1# 的:
    2020-11-17 13:41

    :smile38: :smile37: :smile5: :smile47: :smile48: :smile25: :smile26: :smile29: :smile30: :smile31: :smile33: :smile35: :smile37: :smile3: :smile11: :mrgreen: :smile23: :smile23: :smile26: :smile28: :smile51: :smile51: :smile52: :smile52: :smile52: :smile52: :smile53: :smile53: :smile53: :smile54: :smile54: :smile55: :smile55: :smile55: :smile55: :smile55: :smile55: :smile55: :smile55: :smile55: :smile55: :smile55: :smile55: :smile55: :smile56: :smile56: :smile56: :smile56: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile34: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17: :smile17:

:wink: :twisted: :surprised: :smile: :smile9: :smile8: :smile7: :smile6: :smile5: :smile56: :smile55: :smile54: :smile53: :smile52: :smile51: :smile50: :smile4: :smile49: :smile48: :smile47: :smile46: :smile45: :smile44: :smile43: :smile42: :smile41: :smile40: :smile3: :smile39: :smile38: :smile37: :smile36: :smile35: :smile34: :smile33: :smile32: :smile31: :smile30: :smile2: :smile29: :smile28: :smile27: :smile26: :smile25: :smile24: :smile23: :smile22: :smile21: :smile20: :smile1: :smile19: :smile18: :smile17: :smile16: :smile15: :smile14: :smile13: :smile12: :smile11: :smile10: :smile0: :sad: :rolleyes1: :redface: :razz: :question: :neutral: :mrgreen: :mad: :lol: :idea: :exclaim: :evil: :eek: :cry: :cool: :confused: :biggrin: :arrow:

友情链接: 程序员刘杨 刘杨
Copyright 2003~2018 保留所有权利 | 网站地图
备案号:湘ICP备14001005号-2

湘公网安备 43011102001322号