This is Shane Ng’s GPL-licenced obfuscator. It was originally published on his web site, but for a while it was unavailable. I copied it from Google’s cache and put it here so that it wouldn’t disappear.
You input your Javascript into this program, and it will make it completely incomprehensible. Function and variable names are changed, spaces and line breaks removed, strings made into mixed hexadecimal and Unicode “garbage” etc. This can be used to protect your intellectual property — but remember that the script still works, and can be copied verbatim to another web site.
The code is 500 something lines of Java, and compiles with 1.4 compilers. It is simple to use — just run the program and it will tell you how it works.
Download the source code (.java file) and compile it yourself, or download the cross-platform binary code (.class files).
Update: I recommend that you get this program from the author’s web site instead (but it seems to disappear and change address every now and then).
Some Things to Keep in Mind
- The function calls from your html files are untouched, so you need to change those manually.
- The obfuscated functions are in the same order as those in the original file, so count the functions to find the one you’re looking for.
- If you use function calls within “” (like for setTimeout), they will probably be obfuscated and make your script stop working. Change manually.
September 16th, 2009 at 3:07 am
This obfuscator is discontinued. I wrote a more complex one for JavaScript/HTML/CSS and with a nice UI. You can check it out at http://digua.sourceforge.net