Protecting Proteus programs |
In many cases, it can be useful to protect Proteus scripts when they are released, e.g. to avoid that other people tamper with them, or because you want to protect the intellectual property or the algorithms used, or to avoid that other people copy and/or resell them as if they had written them.
For this reason, Proteus incorporates an encryption system based on random keys; the program PCOMPILE.PRE is available to compile and protect your scripts.
The working principle is very simple. When you are done debugging your program and are ready to release it to the world, compile it by using:
proteus pcompile.pre program.prt
Two files will be produced: program.pre and program.prk.
The extension ".PRE" stands for PRoteus Encrypted; this file actually holds the original program (and all the files referenced in the !include directives), encrypted by using the file ".PRK". This file is randomly generated at compile time and must always be distributed together with its file ".PRE" to let it work. If program.prt is recompiled later and the file ".PRK" is still available, the same keys are used again to recompile the program.
The file program.prk includes a digital signature that easily allows to determine if the program was compiled with a specific hardware key; when running the interpreter with parameter -$:
proteus -$ program.prk
one of the following messages will appear:
Message Meaning authenticity verified - license #licence number the key file was created with the connected hardware key authenticity verification failed the key file was created with a different hardware key authenticity verification impossible the interpreter being used is a demo version (no hardware key); the verification is impossible
Protected programs are run in the same way as unprotected programs; the only difference is that you need to specify the full program name (including extension, which must always be ".PRE"); as already mentioned, the corresponding file ".PRK" must always accompany the protected program.
Note: when runinng protected programs it is not necessary to have connected the same hardware dongle that was used when compiling them; they can be run by the demo version and by another registered version.
To limit script execution to the computers equipped with specific hardware keys, you can use the function W32PROTLICENSE as illustrated in the code fragment below:
; Check the value returned by W32PROTLICENSE ; to determine if the computer can run the application SWITCH W32PROTLICENSE() ON "20040101001", "20040101002", "20040101003" ; All these keys are enabled OTHER CONSOLELN "Unauthorized key!" ABORT 0 OFF ; Key verified: go on
Once the program is protected, it can be run only by computers equipped with the specified hardware keys.
Start of page | Next topic | Previous topic | Contents | Index |