Javascript Obfuscators
JavaScript code can be found in many sources like JavaScript Files, HTML Files, XHTML Files, Server Side Includes Files, ASP Files, ASP.NET Files, ATL Server Files, PHP Files, JSP Files, JSP Document Files, XML Files, XSLT Files, Cold Fusion Files, ePerl Files.
Because JavaScript is an interpreted language hiding the scripts is impossible. Still they can be made more difficult to decipher. Code obfuscators substitute cryptic string tokens and scramble names to make the code virtually unintelligible but still functional.
Obfuscation is the process of concealing the content of the Javascript code from casual view. The reason it should be used is because it stops the theft of the JavaScript source code and it also reduces its size up to 70% which improve the download time and the browser.s speed execution.
The method consists in:
Replacing long descriptive variable and function names with short meaningless ones.
The value starts with a percent sign followed by the character.s two digit hexadecimal value.
Replacing numeric constants with the arithmetic expressions.
The comments and redundant whitespace characters are removed.
In case there is a closure that does not end with a semi-colon, .;., a line break is inserted when .}. is encountered.
Using hexadecimial character codes for all characters in strings.
A line ending with a JavaScript delimiter or a double-slash comment is merged with the next line to a single line.
The entire code is packed as a long line.
To tell the browser how to handle the code the entire obfuscated string should be enclosed inside of an unescape() function call and the functionality remains the same.
There is no decryption script required since the browser interprets the obfuscated values as if there are plain characters instead.
Obfuscation Tools: