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

JScrambler JScrambler

RESTful Web API

Requests made to the server are simple HTTP messages containing parameters that will be used to authenticate and process the request.

Resources

A list of the resources currently available:

All responses are in JSON format.

POST /code.json

Request for JavaScript code transformation.

Parameters

  • filename
  • code

Response


    {
        "id":"401c600215aab40ea4709a3a0075ef196000cdf0",
        "received_at":"2011-01-10 08:41:51",
        "filename":"example.js",
        "size":16868
    }
                

GET /code.json

Get information about your submitted requests.

Parameters

  • status(optional) - success, error, deleted or onqueue
  • offset(optional) - Non-negative integer number e.g. 0, 1, 2, 3, ... (default value is 0)
  • limit(optional) - 1 to 1000 (default value is 100)

Response


    [
        {
            "id":"401c600215aab40ea4709a3a0075ef196000cdf0",
            "received_at":"2011-01-10 08:41:51",
            "filename":"example.js",
            "size":"16868",
            "techniques":["whitespace","rename_local"]},
            "finished_at":"2011-01-10 08:41:57",
            "new_filename":"example.jscrambler.js",
            "new_size":"5577",
            "techniques":["whitespace","dic_compression","rename_all"]
        },
        { ...
    ]
                

GET /code/_id_.json

Get information about the request with the _id_.

Parameters

  • symbol_table(optional)

Response


    {
        "id":"401c600215aab40ea4709a3a0075ef196000cdf0",
        "received_at":"2011-01-10 08:41:51",
        "filename":"example.js",
        "size":"16868",
        "techniques":["whitespace","rename_local"]},
        "finished_at":"2011-01-10 08:41:57",
        "new_filename":"example.jscrambler.js",
        "new_size":"5577",
        "code":"json_encoded_javascript_source_code"
        "symbol_table":"json_encoded_symbol_table"
    }
                

DELETE /code/_id_.json

Delete a request with the _id_.

Parameters

    None other than authentication parameters

Response


    {"deleted":"yes"}
                

Required Parameters

The following parameters are mandatory to all requests.

access_key

Key used to authenticate the user at each request made to the server. Obtainable at the Web UI after signing up.

timestamp

ISO 8601 current time e.g. 2011-01-01T12:00:00+01:00

signature

HMAC signature used to authenticate the user. Check /webapi/authentication for more info.

code (POST only)

JavaScript source code to be uploaded.

filename (POST only)

Name of the JavaScript source code file.

Optional Parameters

The following parameters are optional.

status

Get information about your submitted requests by status.

Value

success - Successfull requests

error - Requests that return a compile error as a syntax or lexical error

deleted - Requests that have been deleted

onqueue - Requests that are on queue to be proccessed

symbol_table

The symbol table contains key-value pairs representing the source code names and their replacements. You may add this parameter to a GET request of a resulting obfuscation and retrieve the respective symbol table. You may also use it as parameter of a POST to pre-populate a symbol table of a new obfuscation request.

GET

Get the symbol table of the resource with the _id_.

Value

%DEFAULT% - default behaviour

POST

Pre-populate the symbol table

Value

name_1,replacement_1;name_2,replacement_2; ... pairs containing a program's source code identifier and its replacement

Examples:

name_1,a;name_2,x; - at the program's source code the identifiers 'name_1' and 'name_2' will be replaced by 'a' and 'x' respectively

whitespace

Shrink the size of your JavaScript removing unnecessary whitespaces and newlines from the source code.

Value

%DEFAULT% - default behaviour

rename_all

Renames all identifiers found at your source code. By default, there is a list of JavaScript and HTML DOM names that will not be replaced. If you need to add additional exceptions use the exceptions_list parameter

Value

%DEFAULT% - default behaviour

exceptions_list

There are some reserved names that should not be replaced or reused to create new declarations. Take as example the HTML DOM Object document and the JavaScript method toUpperCase. Likewise, public declarations belonging to other sources have to be taken into consideration for the same reason. Therefore, a list of JavaScript and HTML DOM names exist to define which should never be replaced or reused by JScrambler. Use this parameter to add your own exceptions.

Value

name|name_1| ... - exceptions list

Examples:

name_1|name_2|name_3 - name_1, name_2 and name_3 if found at your source code will never be replaced as will never be used to create new declarations

rename_local

Renames local (private) names only. The best way to replace names without worrying about name dependencies.

Value

%DEFAULT% - default behaviour

dic_compression

Dictionary compression to shrink even more your source code. In some specific situations may add some cost to the execution.

Value

%DEFAULT% - default behaviour

function_reorder

Randomly reorders function declarations at your source code.

Value

%DEFAULT% - default behaviour

literal

Replaces literals by a randomly sized chain of ternary operators. You may configure the minimum and maximum size limits as the probability of occurrences. See example.

Value

%DEFAULT% - default behaviour

min | max [| percent]

Examples:

1|2 - replace all literals by a one to two sized ternary operator.

0|2|.8 - may or may not (minimum: 0) replace literal. Has a 8 in 10 probability (precent) of replacing a literal by a one to two sized ternary operator.

member_enum

Replaces HTML DOM and Browsers elements (i.e., objects, properties, methods) by a member enumeration selection.

Value

%DEFAULT% - default behaviour

dead_code

Randomly injects dead code.

Value

%DEFAULT% - default behaviour

string_splitting

Splits strings found at your source code.

Value

%DEFAULT% - default behaviour

encode_all

Encodes all your JavaScript.

Value

%DEFAULT% - default behaviour

Note: Do not use this if other scripts depend on the JavaScript you are obfuscating.

domain_lock

Locks your JavaScript to a specific domain of your choosing.

Value

domain - your domain

Example

your.domain.net

expiration_date

Sets your JavaScript to expire after a date of your choosing.

Value

date - date YYYY/MM/DD

Example

2099/12/31

Version 1 | Last modified at March 10, 2011