PHP Javascript Obfuscator

PHP Javascript Obfuscator

Anti-Theft Protection for JavaScript Source Code

Using the JavaScript Obfuscator

As you probably know, WiseLoop PHP Javascript Obfuscator is a JavaScript protector that allows you to obfuscate, scramble, minimize, domain lock, set an expiration date and encrypt your JavaScript source code in order to avoid theft.
This section will show some usage scenarios to provide you fast accommodation with this obfuscator engine.

1. Obfuscating JavaScript files located in a repository using configuration presets

This use case needs the setup of code repositories and configuration presets so please refer to The Code Repository and The Configuration Preset sections.
To obfuscate a JavaScript file located inside the "my-repository" repository using the "my-configuration" preset:

<script src="jso.php?rjs=my-repository/my-js-code-file.js&cfg=my-configuration" type="text/javascript"></script>

By using the repository, the real path of your JavaScript files are hidden and there is no way for the client-side to find out where they are located.
By using the configuration presets, the obfuscation settings are grouped together making it very handy to use the obfuscation engine.

The query passed obfuscation settings have higher priority so if you want to alter just a single obfuscation setting and don't want to create a new configuration preset:

<script src="jso.php?rjs=my-repository/my-js-code-file.js&cfg=my-configuration&doScrambleVars=false" type="text/javascript"></script>

2. Obfuscating an entire repository to merge JavaScript files

This use case needs the setup of code repositories so please refer to The Code Repository section to find out how to setup a JavaScript code repository.
Just by passing the repository name to the obfuscation engine, all the JavaScript files found inside that repository will be merged, obfuscated and delivered as one.

<script src="jso.php?rjs=my-repository&cfg=my-configuration" type="text/javascript"></script>

You can also pass some of query variables (doDecoy, doMinify, doLockDomain, doScrambleVars, encryptionLevel, expirationDate) in order to enable/disable some of the obfuscation features.

3. Separate obfuscation options for JavaScript files located in a repository

This use case needs the setup of code repositories so please refer to The Code Repository section to find out how to setup a JavaScript code repository.
To obfuscate a JavaScript file located inside the "my-repository" repository:

<script src="jso.php?rjs=my-repository/my-js-code-file.js&doDecoy=true&doMinify=true&doLockDomain=true&doScrambleVars=true&encryptionLevel=2&expirationDate=2090-12-12" type="text/javascript"></script>

You can tune the query variables (doDecoy, doMinify, doLockDomain, doScrambleVars, encryptionLevel, expirationDate) in order to enable/disable some of the obfuscation features.
Using the repository, the real path of your JavaScript files are hidden and there is no way for the client-side to find out where they are located.

4. Basic obfuscating of actual files using configuration presets

This use case needs the setup of configuration presets so please refer to The Configuration Preset section to find out how to setup configuration preset.
To obfuscate a JavaScript file located at some/path/to/your/js/directory/my-js-code-file.js:

<script src="jso.php?js=some/path/to/your/js/directory/my-js-code-file.js&cfg=my-configuration" type="text/javascript"></script>

The query passed obfuscation settings have higher priority so if you want to alter just a single obfuscation setting and don't want to create a new configuration preset:

<script src="jso.php?js=some/path/to/your/js/directory/my-js-code-file.js&cfg=my-configuration&expirationDate=2090-12-12" type="text/javascript"></script>

This method is not recommended as just a simple browser request to "some/path/to/your/js/directory/my-js-code-file.js" will reveal the original JavaScript source code.

5. Very basic obfuscating of actual files by query parameters

This use case does not need any other settings besides the installation.
Please refer to to Installation section to find out how to install the WiseLoop PHP JavaScript Obfuscator.
To obfuscate a JavaScript file located at some/path/to/your/js/directory/my-js-code-file.js:

<script src="jso.php?js=some/path/to/your/js/directory/my-js-code-file.js&doDecoy=true&doMinify=true&doLockDomain=true&doScrambleVars=true&encryptionLevel=2&expirationDate=2090-12-12" type="text/javascript"></script>

You can tune the query variables (doDecoy, doMinify, doLockDomain, doScrambleVars, encryptionLevel, expirationDate) in order to enable/disable some of the obfuscation features.
This method is not recommended as just a simple browser request to "some/path/to/your/js/directory/my-js-code-file.js" will reveal the original JavaScript source code.

6. Inline Obfuscation

Sometimes, JavaScript code does not reside inside a separate file and it must be placed inline in the HTML code.
It is possible to render inline obfuscated JavaScript code by explicitly calling the obfuscation engine:

<script type="text/javascript">
<?php
    require_once 'wlJSOProcessor.php';            //include the library

    $config = new wlJSOConfig();                  //create a configuration and fill its values
    $config->DO_MINIFY = true;
    $config->DO_LOCK_DOMAIN = false;
    $config->DO_SCRAMBLE_VARS = true;
    $config->ENCRYPTION_LEVEL = 1;
    $config->SHOW_JS_LOCK_ALERTS = false;
    $config->EXPIRATION_DATE = '2090-12-12;

    $jso = new wlJSOProcessor();                  //create an obfuscator processor object
    $jso->init($javaScriptCode, 'my-cfg-preset'); //initialize the obfuscator engine considering the JavaScript code and the config preset name
    echo $jso->get();                             //render the obfuscated JavaScript code
?>
</script>

Or shorten syntax (refer to wlJSO for more information):

  • using a configuration preset:
    <script type="text/javascript">
    <?php echo wlJSO::obfuscateByPreset($javaScriptCode, 'my-cfg-preset'); ?>
    </script>
    
  • having some default config values for obfuscation engine:
    <script type="text/javascript">
    <?php echo wlJSO::obfuscate($javaScriptCode); ?>
    </script>
    

Due to the fact that the original JavaScript code is not contained inside a file, DO_DECOY is ignored and no caching will be available when obfuscating inline JavaScript code.

Regular License $19.00
Use by you or one client, in a single end product which end users are not charged for.

Extended License $95.00
Use by you or one client, in a single end product which end users can be charged for.

Short Information

Obfuscate, scramble, minimize, domain lock, set an expiration date and encrypt your JavaScript code to protect it against theft!
This safe JavaScript anti-theft protection allows you to deliver live obfuscated encrypted JavaScript code by online processing the original source code directly on the server side, so no offline processing is needed. Just copy your original JavaScript source code to the server, and deliver it to the browser through the WiseLoop PHP Javascript Obfuscator and you will be protected against theft.

Buyer rating:
462 Sales