JavaScript Obfuscation Examples
Here are presented some compression, minification and obfuscation transformation examples that you will find at JScrambler JavaScript Obfuscator. Check out obfusacation transformations being applied sequentially on the following example:
The Original Source Code
The SJCL browser test script was selected as an example. Click here for additional detail (Try the test page).
Comments Removed and Local Names Replaced
Removing comments and replacing local names by meaningless smaller ones. Click here for additional detail (Try the test page).
HTML DOM Enumeration, String Splitting and Literal Hooking
Member enumeration of HTML DOM elements, splitting strings and replace literals by a randomly sized chain of ternary operators. Click here for additional detail (Try the test page).
JavaScript Compression and Domain Lock
Compress source code for faster loading times and locks the code to only run at a specific domain. Click here for additional detail (Try the test page).
Are you looking for minification transformation examples?
Transformation examples
Below are some simple examples of transformations that you will find in JScrambler JavaScript Obfuscator. Sign up and evaluate the full impact of the advanced transformations provided by JScrambler.
- Replacing commonly used HTML DOM and browser's elements by a member enumeration selection
-
source code:
navigator.plugins.length
-
obfuscated code:
var _=this;
for (H in _)
if(H.length==9&&H.charCodeAt(0)==110&&H.charCodeAt(8)==114)
break;
for ($ in _[H])
if($.length==7&&$.charCodeAt(0)==112&&$.charCodeAt(6)==115)
break;
_[H][$]["length"]; - Replaces literals by a randomly sized chain of ternary operators
-
source code:
for(i=0; i<length; i++) {
//code
}
-
obfuscated code:
for(i=((90.0E1,0x5A)<=(0x158,140.70E1)?(.28,3.45E2,0):(95.30E1,26.40E1)<=1.400E2?(1,this):(108.,0x227));i<length;i++) {
//code
}
With JScrambler you can combine all the transformations available making the end result much stronger!
Last modified at May 16, 2011



