Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best JavaScript compression/obfuscation tool? [closed]

What kind of a tool would you recommend for JavaScript compression and/or obfuscation? A google search comes back with a lot of online tools, but I am not sure how to gauge their effectiveness/usefulness.

Is there a tool that you would recommend for this?

Thanks,

like image 599
Goro Avatar asked Aug 04 '11 21:08

Goro


People also ask

Is it possible to obfuscate JavaScript?

JavaScript obfuscation is a series of code transformations that turn plain, easy-to-read JS code into a modified version that is extremely hard to understand and reverse-engineer. Unlike encryption, where you must supply a password used for decryption, there's no decryption key in JavaScript obfuscation.

Which of the below tool can be used for JavaScript obfuscation?

Tools For Code Obfuscation In Javascript You can use an online tool like: JavaScript Obfuscator. Beautifytools.

Should I obfuscate JavaScript?

Obfuscating your code is not a good idea. It will only inconvenience legitimate users (eg. when they need to fix a bug), and do nothing to 'protect' it from people who have a (financial) incentive to reverse-engineer it. It is fundamentally impossible to prevent reverse-engineering of Javascript code.

How do I obfuscate a JavaScript file?

Press F12 to open Developer Tools inside Chrome. Now switch to the Scripts tab, right-click and choose De-obfuscate source. That's it! Alternatively, go to jsbeautifier.org and copy-paste the cryptic JavaScript /HTML code that you are trying to understand.


1 Answers

There are many tools that transform Javascript in something different. I currently classify these tools in the following objectives:

  1. Minify: make the code smaller by removing comments, renaming variables...
  2. Compress: Compress using non destructive compression of javascript
  3. Optimize: Make the code run faster (ex: Closure)
  4. Obfuscate: Protect the code

My order has some meaning behind it. Because generally the higher level includes all be features below.

So a good Javascript Obfuscator is able to minify, compress, optimize...

Many tools do some of these levels well individually. They can be combined making them more effective but my experience has shown that combining several such tools make it a nightmare to try and pin point a problem.

My suggestion for a good overall Javascript obfuscator would be to use jscrambler.com

For optimization and minification google closure (has sugested by aepheus) is a excellent solution.

like image 137
rmribeiro Avatar answered Oct 07 '22 01:10

rmribeiro