Using external script license generator (full version only)

Top  Previous  Next

The Script License Generator is an external tool for creating script license files. A Script license file is required to run protected scripts encoded with the --external option.

 

Using the script license is the best way of encoding if you need to distribute one script or entire project between different users but need to use different restriction options for each user. You need to encode your scripts with the --external option using SourceGuardian™ 7.1 for PHP and then create a license for each user with the SourceGuardian™ 7.1 for PHP Script License Generator.

 

Scripts encoded with the --external option will require an external license file to run. Protected scripts will search for the license file in the current directory and all parent directories. So you may have one license file for an entire protected project located in the top project directory.

 

If the protected script cannot find the specified license file it will come with the error message: "script requires ... file to run"

 

A new protection algorithm for external script license protection has been introduced in SourceGuardian 5.0. This algorithm gives your scripts much stronger protection from reverse engineering, unlocking and bytecode stealing, but it also gives you the most flexible way to generate trial versions of your products and to lock scripts to your customer's machine.

 

This method requires the use of a *license file* for your protected scripts to run. This is most powerful and flexible way to protect your scripts. We recommend you to use external license files for all your script protection.

 

Algorithm description

 

This new algorithm uses the idea of two keys. The first key (Project Id) is stored in the encrypted area of the protected script and is used to decrypt an external license file. The second key (Project Key) is stored in the license file and it is used to decrypt the bytecode from the protected script.

 

Using the new algorithm protects your product by preventing a full working copy from being created from, for example, a demo version.  To decrypt and run a protected script a true license file for the full version of your product is required. Otherwise it's impossible to decrypt and run the bytecode. 

 

Project Id and Project Key values are required if the external license protection method is chosen. 

 

You should specify Project Id (--projid) and Project Key (--projkey) values using options in the command line for "encode4" or "encode5" commands. Project Id and Project Key may be any words, numbers or random sequence but for security reasons these two values *should not* be calculated from each other. They should be independent. Also you should specify the *same* Project Id, Project Key pair for "licgen" command when generating a license for previously protected scripts.

 

Command line example:

 

encode4 --external script.lic --projid "19Gh42Ki" --projkey "Ab65qZ32" myscript.php

licgen  --projid "19Gh42Ki" --projkey "Ab65qZ32" --days 7 script.lic

 

- Other advantages

 

If you have licenses for multiple SourceGuardian installations you may encode scripts on one machine and generate license files on another machine. The only condition is to set the same Project Id and Project Key values for your project on different machines.

 

- Error messages

 

If a script is run with an incorrect license file the following error message will appear:

 

"Fatal error:  SourceGuardian Loader - script license is invalid [06] in ..."

 

If script is run with a license file with correct Project Id but incorrect Project Key (this may be a cracking attempt or accidental modification of the license file or script) the following error message will appear:

 

"Fatal error:  SourceGuardian Loader - script checksum error [12] in ..."

 

- Important Security Notice!

 

(!) Keep your Project Id and Project Key values in a secret.

 

(!) Remember your Project Id and Project Key. It's impossible to restore the values from somewhere if forgotten. They are required for generating licenses for your customers. GUI users - Project Id and Project Key are stored in SourceGuardian project file.

 

(!) When generating the Project Id and Project Key manually, please use independent values.

 

- Encoding without external script license file

 

You may still encode your scripts with an embedded license. In this case Project Id and Project Key values are not required. Project Id will be required for "conjunction" feature (see below).