最难逆向的 JavaScript 混淆器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6697181/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Hardest-To-Reverse JavaScript obfuscator
提问by cmc
I am looking for the currently hardest-to-reverse JavaScript obfuscator. Bonus points if it can be run on one's own server. Performance hit and code bloat are fine.
我正在寻找目前最难逆转的 JavaScript 混淆器。如果它可以在自己的服务器上运行,则加分。性能下降和代码膨胀都很好。
回答by tadman
回答by cmc
The JavaScript Code Encrypter And Obfuscatorlooked nice, until I actually tried to attack it. Took me about two minutes. The trivial solution:
该JavaScript代码加密器和混淆器看起来不错,直到我真正想攻击它。花了我大约两分钟。微不足道的解决方案:
for (i in window) { console.log(window[i]) }
That churned out a bunch of gibberish, but also the original code neatly boinked into one variable.
这产生了一堆胡言乱语,但原始代码也巧妙地变成了一个变量。
Note to self: Never, ever, ever, ever use anything you don't fully understand when it comes to security.
自我注意:永远,永远,永远,永远不要使用任何您在安全方面不完全了解的东西。
回答by aepheus
I'd be curious as to why you want to do this. Obfuscation offers no real protection. If you have something to protect, move it to the server-side, otherwise, why bother. If you're doing as you should and minifying/combining your JS that should be more than enough to scare away anyone not serious about knowing what your code is doing, and has performance benefits to boot. If they are serious, obfuscation isn't going to help you.
我很好奇你为什么要这样做。混淆不能提供真正的保护。如果您有要保护的东西,请将其移至服务器端,否则,何必费心。如果你正在做你应该做的事情并缩小/组合你的 JS,这应该足以吓跑任何不认真了解你的代码在做什么的人,并且具有启动的性能优势。如果它们是严重的,混淆不会帮助你。