Re:Improving our homemade JavaScript obfuscator
by bestest on Monday September 09, 2019 @05:28AM
(#20916556)
Absolutely correct. Yet the only point of obfuscating JavaScript I can see is to execute malign code, which implies that it's targeted at people who "won't bother" deobfuscating or even looking at it anyway, which makes obfuscation redundant. And obfuscation won't stop a determined engineer anyway. So, uh, ¯\_(ツ)_/¯.
Thus, it only looks vaguely interesting from an academic point of view. But even then, it's just a matter of flattening and spamming the AST, but you can only get this far with JS.
Re:Improving our homemade JavaScript obfuscator
by caffeinewriter on Monday September 09, 2019 @06:00AM
(#20916715)
I think you're quite correct. If you're investing in obfuscation, you're probably making the wrong investment. Malicious actors have to obfuscate to avoid detection for as long as possible, and benign actors would probably be better served focusing on their core tech. That said, obfuscation is very good at increasing the difficulty of interpreting and understanding the purpose of code.
Re:Improving our homemade JavaScript obfuscator
by userbinator on Monday September 09, 2019 @07:53AM
(#20917268)
obfuscated JS is still harder for humans to parse
No one serious will analyse obfuscated JS without passing it through a deobfuscator first, so the point is moot. But if you really want to make your code "look confusing", there's more amusing obfuscators for that (also easily deobfuscated):
For example:
and are functionally identical. (I used an off the shelf obfuscator)No amount of obfuscation will stop a determined reverse engineer from pulling apart your code, but it can increase the cognitive load to the point where most people won't bother.
Also, just in case, nobody should ever run untrusted code, particularly not obfuscated untrusted code. Including the examples I posted above.