PHP 代码混淆 HTML?
我知道,我知道 - 混淆的 html/js 代码是无用的(我阅读了其他问题),但我仍然想让我的网站的复制者的生活变得更加困难......
我正在运行一个基于 php 的网站,生成 html 输出。我希望最终的 html 输出(包含 html、js、json 并使用 ajax)被混淆。有没有 php 函数可以达到这个目的?我发现 http://www.ioncube.com/html_encoder.php 但这依赖于一些他们的特殊软件要加载到服务器上 - 即,不行...
有什么建议吗?
I know, I know - obfuscated html/js code is useless (I read the other questions on SO), but I still want to make life harder for copy-cats of my site...
I'm running a php based website, which generates html output. I would like the FINAL html output (which has html, js, json and uses ajax) to be obfuscated. Is there a php function for that purpose? I found http://www.ioncube.com/html_encoder.php but that relies on some of their special software to be loaded on the server - ie, a no-go...
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
不是真正的混淆,但在大多数情况下很难阅读(并且带宽占用也较少!)
Not true obfuscation, but rather hard to read in most cases (and less bandwidth-intensive as well!)
您可以压缩 JavaScript 和 css
对于 php 输出,可以使用
ob_start
来完成,看看这个 http://ru.php.net/manual/en/function.ob-start.php#71953You can compress your JavaScript and css
For php output it can be done using
ob_start
have a look at this http://ru.php.net/manual/en/function.ob-start.php#71953您应该看看 Minify 它有一个 Minify_HTML 类 删除空格、不必要的注释和标记
You should have a look at Minify it has a Minify_HTML class removing whitespace, unnecessary comments and tokens
嗯,在我对HTML混淆器的研究中,像http://htmlobfuscator.com/,都是真正改变了他们的“特殊”代码转换成反向的base64。
当我们解码它时,它们实际上是使用你可以在Google上找到的打包器打包的js文件。
所以,现在我们可以这样做
Slashup整个html,为Js字符串,然后“打包”javascript,然后将其编码为base64,然后旋转编码后的字符串。中提琴,完成。
你会得到这样的东西:
祝你好运~
Well, in my studies of HTML obfuscator, like http://htmlobfuscator.com/, are truely change their "special" code into reversed base64.
When we decode it, they're actually packed js file using packer that you could find on Google.
So, now we could do this
Slashup the whole html, for the Js string, then "pack" the javascript, then encode it into base64, then rotate the encoded string. Viola, done.
You'll get something like this:
Good luck~
不,如果没有客户端,php 就无法做到这一点。你总是可以使用一些 javascript 对其进行解码,但这对于关闭它的人来说并不友好,它会很慢并且没有搜索引擎支持。
No, php couldn't do that without something on the client side. You could always have some javascript decode it, but that wouldnt be friendly to whoever has it turned off, it would be slow and no search engine support.