Looking for the best way to protect your JavaScript source code? Stop looking. Sign up now! Did you forget your password?

JScrambler JScrambler

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:



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