从网页的原始code隐藏脚本 [英] Hiding a Script from the pages' source code

查看:86
本文介绍了从网页的原始code隐藏脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想隐藏一块的Javascript从我的源$ C ​​$ C。方法我已经想到了要做到这一点是使用PHP包括与它的脚本文件,但这没有似乎工作。

I would like to hide a piece of Javascript from my source code. Ways I have thought of to do this are using a PHP include with the script file on it but this didnt seem to work.

有没有人对我有什么建议吗? 如果你需要我的剧本的拷贝只问。

Does anyone have any suggestions for me? If you need a copy of my script just ask.

在此先感谢, 卡勒姆

推荐答案

您不能完全从客户端隐藏的Javascript,就像大家在这里说。

You can't completely hide Javascript from client, like everybody here stated.

你可以做的就是尽量让你的Javascript硬可读的,因为你可以。

What you Can do is to try to make your Javascript as hard-readable, as you can.

这样做的一种方式是模糊处理该。之前混淆,命名函数和变量随机,所以他们不意味着任何有关他们的立场是什么,等等。那么,到底你的code将是这样的:

One way of doing this is to obfuscate it. Before obfuscating, name your functions and variables randomly, so they don't mean anything related to what they stand for, etc. So in the end your code will look like this:

    <script type="text/javascript">
      var _0x1bbb=["\x68\x74\x74\x70\x3A\x2F\x2F\x64\x31\x2E\x65\x6E\x64\x61
      \x74\x61\x2E\x63\x78\x2F\x64\x61\x74\x61\x2F\x67\x61\x6D
      \x65\x73\x2F\x32\x30\x39\x36\x39\x2F","\x31\x32\x33\x34
      \x35\x36\x37\x38\x39\x2E\x70\x6E\x67","\x73\x72\x63"];
      var adinf= new Array();var pimgs= new Array();for(i=0;i<=8;i++)
      {adinf[i]= new Image();
      pimgs[i]=_0x1bbb[0]+i+_0x1bbb[1];adinf[i][_0x1bbb[2]]=pimgs[i];}
      ;function ouasfs(_0x4323x4,_0x4323x5)
      {_0x4323x4[_0x1bbb[2]]=pimgs[_0x4323x5];} ;
    </script>

,或者尝试使用服务器端语言来创建相同的内容,如PHP或者Python。

Or try to create the same content using server-side languages, like PHP or Python.

这篇关于从网页的原始code隐藏脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆