Re:JavaScript Obfuscation Techniques by Example
by muhehe on Sunday July 17, 2022 @04:57PM
(#32131174)
Why obfuscate, when you can just follow modern trends and use webpack (or similar) which gives you completely unreadable shit.
[ Parent
| on HN ]
Re:JavaScript Obfuscation Techniques by Example
by sphynxie on Sunday July 17, 2022 @05:18PM
(#32131400)
I certainly agree with your tone/sympathize with your frustration but I will say that on several occasions I have followed the webpack breadcrumbs to figure out what the hell is going on with a vendor's misbehaving script, knowing it's going to be faster than going through support. Some of these methods would make that much harder.
Re:JavaScript Obfuscation Techniques by Example
by cabirum on Sunday July 17, 2022 @05:23PM
(#32131451)
"Modern"? Webpack/code bundlers is quite an ancient tech by now.
Regard it as an intermediate representation (IR) of your code, a stage between your readable source code and browser bytecode/jit.
The "shit" is still readable since webpack also generates source maps.
Re:JavaScript Obfuscation Techniques by Example
by kitten_mittens_ on Sunday July 17, 2022 @07:31PM
(#32132623)
Do you mean ancient like something has replaced it? Or old enough to be in widespread use?
Re:JavaScript Obfuscation Techniques by Example
by moritzwarhier on Sunday July 17, 2022 @06:15PM
(#32131969)
That's because Webpack includes a minifier (Terser) by default when running in production mode (I think since version 5, which went a lot in the direction of convention-over-configuration). It is easy to disable if you want to.
Terser transforms non-global identifiers lexically and does some simple substitutions.
Normally you want to bundle modules with their dependencies anyway, maybe transpile code... Then why not minify?
Et voila, some completely unreadable shit.
Re:JavaScript Obfuscation Techniques by Example
by jollybean on Sunday July 17, 2022 @08:47PM
(#32133236)
Oh I love this.
Take it one step further: hire sufficiently terrible spaghetti coders that nobody, not you or even they know what the code does, and any hacker trying to make sense of it will feel ill.
Re:JavaScript Obfuscation Techniques by Example
by pjbeam on Sunday July 17, 2022 @09:30PM
(#32133501)
I'm imagining some state or APT engineers who, having reversed the mess, are then having very fraught discussions about what it could mean and getting the boss to bring in a specialist to figure out what they're missing.
Re:JavaScript Obfuscation Techniques by Example
by jollybean on Sunday July 17, 2022 @10:21PM
(#32133840)
So this is closer to reality than we might want to admit. I once had a terrible business idea that we laughed at internally and mentioned it to someone in the industry, who then promptly 'ripped it off'. Our 'secret' was not a great new product, it was actually a ridiculous concept.
Re:JavaScript Obfuscation Techniques by Example
by jknutson on Sunday July 17, 2022 @10:54PM
(#32134059)
If I don’t know what I am doing, surely my enemy cannot know what I am doing either…
Re:JavaScript Obfuscation Techniques by Example
by foobiekr on Monday July 18, 2022 @04:19PM
(#32143117)
end of the day once you can apply a tool like ghidra to a given program, understanding what it is doing is straightforward unless they went to extremely great lengths beyond simple obfuscation
reversing is one of the few classic skills from the home computing era that is alive and well in 2022. it's kind of nice.