在发送到客户端之前乱码 JavaScript 代码
如何在将 JavaScript 代码发送到客户端之前对其进行乱码? 我不想暴露功能。 代码已使用 jsmin
进行压缩。
How can I garble JavaScript code before sending it to client-side? I don't want to expose functionalities. The code is already compressed using jsmin
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您需要一个混淆器,请参阅此作为示例。
任何有足够决心的人总是可以逆转它,并且工具这样可以提供帮助。
You need an obfuscator, see this for an example.
Anyone determined enough can always reverse it though, and tools like this can help.
Javascript 被解释为明文。 因此,任何混淆充其量只是安慰剂,而且很容易逆转。
更重要的是,如果您编写了足够多的 Javascript 来构成具有足够保护价值的作品,那么您就做错了。
我现在的 Javascript 包括 jQuery、一些插件和一些用于激活这些插件并进行一些样式设置的代码。
我很难想象用 Javascript 编写任何足够重要的东西,以至于我会关心保护它,但这也好,因为你无法保护它。 并不真地。
Javascript is interpreted plaintext. As such any obfuscation is a placebo at best and easily reversed.
More to the point, if you're writing enough Javascript to constitute a work valuable enough to protect, you're doing something wrong.
My Javascript these days consists of including jQuery, a handful of plug-ins and some code to activate those plug-ins and do some styling.
I have a hard time envisioning writing anything in Javascript significant enough that I'd care about protecting it, which is just as well because you can't protect it. Not really.
您可以尝试一些在线混淆器,如下所示:
http://www.javascriptobfuscator.com/Default.aspx
You could try some online obfuscator like this:
http://www.javascriptobfuscator.com/Default.aspx
在 google 中搜索:Javascript obfuscator
您也可以将您的平台添加到查询中。 已经有很多工具可以合并到您的项目中。
Search google for: Javascript obfuscator
You might add your platform to the query, as well. There are plenty of tools already out there that you can incorporate into your project.
警告:互联网上最容易混淆的 JS 是安全漏洞利用代码。 您可能会被误认为是漏洞,尤其是被更偏执的防病毒扫描程序误认为是漏洞。
A word of warning: most obfuscated JS on the internet is security hole exploit code. You risk being mistaken for a sploit, particularly by the more paranoid anti-virus scanners.