JavaScript 混淆和缩小
现代 JavaScript 混淆/缩小工具能在多大程度上保护我的代码免遭逆向工程?另外,哪些混淆平台最适合防止这种情况?制作一个程序来对代码进行反混淆并让这个过程变得毫无意义似乎是相当容易的。
如果这不是完美的,是否有任何依赖于远程服务代码的解决方案?
How well can modern JavaScript obfuscation/minification tools protect my code from reverse engineering? Also, what obfuscation platforms are the best for preventing this? It seems it would be rather easy to make a program to deobfuscate code and make the process rather pointless.
If this is not something that is perfect, are there any solutions that rely on code being served remotely?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过混淆,您所能做的就是让坚定的黑客更加努力,以便借用您的代码或了解如何使用您的代码。如果他们下定决心,你就无法阻止。
有很多程序可以对代码进行精简,使其再次可读或可调试。删除所有有意义的变量名称和明显的代码注释确实会让人们更容易理解代码,但并不能阻止坚定的黑客这样做。
必须受到保护的算法或商业秘密不应该在客户端 JavaScript 中,而应该在服务器上执行,并将结果直接放入页面或通过 ajax 调用放入页面。
All you can do with obfuscation is make a determined hacker work more in order to borrow your code or understand how to use your code. You cannot prevent it if they are determined.
There are lots of programs out there that will de-minify code to make it readable or debuggable again. Removing all the meaningful variable names and obviously code comments does make it more work for someone to understand the code, but does not prevent a determined hacker from doing so.
Algorithms or trade secrets that must remain protected should not be in client-side javascript, but rather should be performed on a server with results put directly into the page or put into the page via ajax calls.