隐藏html5 / javascript代码的方法 [英] Ways to hide html5/javascript code

查看:219
本文介绍了隐藏html5 / javascript代码的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何隐藏或加密javascript代码?






<我想制作javascript + html5应用程序,但我不想向人们展示我的引擎。有没有办法隐藏网页浏览器渲染页面不需要的部分代码?



如果有可能的话我想避免使用php ...... / p>

现在我考虑一下,将权限设置为仅执行的外部.js不会执行该技巧或根本不加载吗?



令人遗憾的是html5无法使用.dll's ...


你可以缩小和贬低。是否有一个特定的原因你不想使用服务器端语言或者它只是你反对的php?


我想要避免服务器端语言,因为我有便宜的托管。更多用户会杀死我的网站。


这是一个祝福html5不能使用.dlls; o)


如果你想要主要在客户端运行的封闭源网站......无论如何......



谢谢你的回应,蒂姆和其他人!我将尝试缩小和捏造javascript,并在php中执行关键部分。

解决方案

如果它会随时下载到用户代理(Web浏览器),您无法真正隐藏它。



如果您有复杂/专有的流程,在服务器上运行(使用您选择的任何语言,包括JavaScript)并仅将结果返回给浏览器。



如评论中所述,您可以<通过缩小/混淆代码来解释来源更加困难。



缩小可以使你的脚本显着缩小并将多个文件合并为一个,所以它绝对是一件好事;只是没有安全机制。缩小代码通常(直接或间接)混淆代码,即它更难阅读和解释,但仍然可以由一个温和的观察者完全访问。



供参考,这个是一个很好的缩小工具列表:是否有一个好的JavaScript缩小器?


现在我想一想,不会将具有权限的外部.js设置为
来仅执行诀窍或它根本不会加载?


这是与服务器相关的权限。如果代码可以由浏览器执行,则确定的(甚至是偶然的)用户可以获得源。


我想避免服务器端语言,因为我有便宜的主机。
更多用户会杀死我的网站。


参见如何找到符合我要求的虚拟主机?



您可以使用免费工具在自己的机器上开发,甚至最基本的主机软件包通常至少提供一种服务器端语言。


这是一个祝福html5不能使用.dlls; o)



如果你想要一个主要在客户端
边运行的封闭源网站......无论如何......


这对本机代码来说完全糟糕...... DLL需要编译成机器每个平台的代码。使用中间代码(如CIL)仍然需要每个用户都安装了运行时,它的反向工程几乎和JavaScript一样容易。


Possible Duplicate:
How to hide or encrypt javascript code?

I would like to make javascript+html5 app, but I don't feel like showing my "engine" to people. Is there any way to hide part of the code that is not needed for web browser to render page?

And I want to avoid php if it is possible...

Now that I think about it, wouldn't external .js with permissions set to "execute only" do the trick or it wouldn't load at all?

It's a shame that html5 can't use .dll's...

You can minify and obfusticate. Is there a specific reason you do not want to use a server side language or is it just php you are against?

I want to avoid server side languages, because I have cheap hosting. More users would kill my site.

It's a blessing html5 cannot use .dlls ;o)

If you want closed source website that's running mostly on client side... whatever...

Thanks for response, Tim and everyone else! I'll try to minify and obfusticate javascript, and do crucial parts in php.

解决方案

If it gets downloaded to the user agent (web browser) at any point, you can't truly hide it.

If you have a complex/proprietary process, run it on a server (in any language you choose, including JavaScript) and return only the results to the browser.

As noted in the comments, you can make interpreting the source more difficult by minifying/obfuscating the code.

Minification can make your scripts significantly smaller and combine multiple files into one, so it's definitely a good thing; just not a security mechanism. Minifying code usually (directly or indirectly) obfuscates the code, i.e. it is harder to read and interpret, but still fully accessible to a mildly determined observer.

For reference, this is a good list of minification tools: Is there a good JavaScript minifier?

Now that I think about it, wouldn't external .js with permissions set to "execute only" do the trick or it wouldn't load at all?

That's a server-related permission. If code can be executed by the browser, a determined (or even casual) user can get the source.

I want to avoid server side languages, because I have cheap hosting. More users would kill my site.

See How to find web hosting that meets my requirements?

You can develop on your own machine using free tools and even the most basic hosting packages usually offer at least one server-side language.

It's a blessing html5 cannot use .dlls ;o)

If you want closed source website that's running mostly on client side... whatever...

That would be utter hell with native code...the DLLs would need to be compiled into machine code for every platform. Using intermediate code (like CIL) which would still require that every user had a runtime installed, it would be nearly as easy to reverse engineer as JavaScript.

这篇关于隐藏html5 / javascript代码的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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