I've had several readers ask me about JavaScript recently, so I decided to write a comprehensive article about it.
Want to learn advanced techniques? Check out our premium courses.
正文
provides a step-by-step approach to exploring key questions, namely: What is an obfuscation code?
What is JavaScript obfuscation, and how does it work?
What are the obfuscation techniques and metrics in JavaScript?
Why isn’t JS obfuscation frequently not enough to cover some use cases?
Familiarity with JavaScript and npm is a plus, but not necessary to dive into this guide. Let’s get into it!
is a technique used to transform plain, easy-to-read code into a new version that is deliberately hard to understand and reverse-engineer—both for humans and machines.
Think of obfuscation like this: you call a friend to schedule a coffee for later (remember when that was a thing?). A possible reply would be something like:
“Hi! Sorry, I can’t do it today. I have to watch the kids. Same time tomorrow?”
But let’s imagine that your friend decided to obfuscate this a bit, hitting you with a hearty
“Good morrow. I offer thee the sincerest of apologies, but, alas, I can’t doth t the present day. Haply tom’rrow, equal timeth? Has’t to taketh careth of mine own children, I do. Sinc’re apologies I offer thee. Fare thee well.”
Well, that was a mouthful. If you take a closer look at your friend’s Shakespearean reply, it’s clear that the whole thing is unnecessarily complicated. It takes a lot longer to decipher the meaning of the message, and there are some redundancies. Plus, your friend added some irrelevant details. Sure, you can bear to decipher this nonsense once. But will you keep calling your friend if this becomes a permanent thing?
As silly of an example as this may seem, it includes the same reasoning as some techniques used in code obfuscation. In the next chapter, we’ll see real examples of obfuscation of code, and you’ll hopefully see the resemblance.
While (thankfully) there aren’t many real-life examples of obfuscation in human conversation, obfuscation of code has been around for a long time – there are references to “code obfuscation” in books dating back to 1972.
, notably C/C++ (there’s even a competition for obfuscating C code) and Perl. But
there’s a language where obfuscation has gained tremendous popularity
More Details
There are a few more points worth noting. First, browser compatibility varies across different browsers. Second, performance optimization is crucial when handling large amounts of data. Finally, key management is also an important consideration.
If you found this useful, please like and share! Follow for more content on this topic.
Reference: JavaScript Obfuscation: The Definitive Guide | Jscrambler