Products
Services
Contact Us

Scripts: Javascript :: Compressors and Obfuscators :: Library Article #36

Developer's Section

Compress / Encrypt / Obfuscate Javascript Code using Base 64 Encryption
By: Erobo Software

Hire a Developer for Related Work / Installation | $55 hr
Rating:  | Rate It:   
Average Votes: (2414)
Favorites:

Learn how to efficiently compress Javascript Code using Base 64 Encryption.

Sometimes it is a requirement to compress / encrypt / obfuscate Javascript code since competitors and hackers want to clone, copy and decipher the definitions of the client side code of your web page putting your website and clients at risk. For this critical task you can use The Fast Wave Encryptor as it will compress using base64 algorithms your Javascript code making it unreadable or indecipherable. Below is a demo:



    

A couple of notes:

Sample Usage:

 Code Snippet 1

<script src="36/scripts/fast_wave_encryptor.js"></script>
  
<script language="Javascript">

function encryptmyfield(input) {
  var fastwave = new Fast_Wave_Encryptor;
  fastwave.imgPath = "36/images/";
  fastwave.workerPath = "36/scripts/";
  //Parameter#1 : The input field you are using to Encrypt the contents.
  //Parameter#2 : Always set to true to allow base 64 encryption to take place.
  //Parameter#3 : Shrink variables (Not recommended for long lines of code). In some cases
  //              shrinking variables can corrupt the code itself or produce Javascript errors.
  //              However, If you need maximum encryption set to 1 but ensure to test the code
  //              accordingly.
  //Parameter#4 : The reference to a span that is going to show you the progress (Red Bars).
  fastwave.pack(input, 1, 0, "ref_update");
}

function decryptmyfield(input) {
  eval("var value=String" + input.value.slice(4));
  input.value = value;
}

</script>
<textarea name="encrypt_input" id="encrypt_input" rows="10" cols="80"></textarea>
<br />
<span id="ref_update" name="ref_update"></span>
<br />
<button id="pack-script" type="button" onclick="encryptmyfield(document.getElementById('encrypt_input'))">
Compress / Encrypt / Obfuscate
</button> 
    
<button id="unpack-script" type="button" onclick="decryptmyfield(document.getElementById('encrypt_input'))">
Decode
</button> 

Downloads
fast_wave_encryptor.js378 KB
fast_wave_encryptor_worker.js88.3 KB
invisible.gif0 KB
progress_bar_sp.gif0.6 KB
 

See other Scripts in Compressors and Obfuscators

 

Submit Your Scripts:

If you would like to have your Javascripts published in this section please fill out
the form below:
*Your Name or Username:
Home Town:
*Email:
*Description and Code:
*Enter Code shown
to the right:

[ Refresh Image ]