Last modified: September 20, 2009 01:54:03.

CodeLock

CodeLock rates a special mention because it is an interesting deviation from how most PHP script encoders are implemented. It is written entirely in PHP4/5, which means that you won't need a compiled decoder for your specific platform; CodeLock will run under any version of PHP4/5.

Despite what I wrote earlier about having the decoder stub written in PHP, not only does it do a fairly decent job of obfuscating the decryption scheme, it is also super- fast. There is virtually no discernable difference in speed between an encoded and unencoded script.

Here's a script encoded using CodeLock:

    <?php
        $codelock
.="NQz͂z{x:;MQP";
        
$codelock.="n";
        include(
'codelock.php');
    
?>;

The decoder script itself is also fairly well obfuscated. Below is an abridged sample of the decoder script:

    <?php
        $codelockx
="********,,,99999999
        "
;$V78a3="";$V9db4="*8Z7i<;9e;:!Hwyfwxv*<*8gshipsg
        o*G*415*=!F*4*8Z<4gef=6<!Hwyfwxv*<*8gshipsgo|*G*41
        <*=!F*4*8Z8i=66<5j!Hwyfwxv*<*8gshipsgo|*G155*G7*=!
        F*4*8Zii=j46<;!Hwyfwxv*<*8gshipsgo|*G15=*G<*=!F*4*
        8Z;8ijeeg6!Hhexi*<*6]qh*6*Gxmqi*<*=*=!F*4jsv*4*<*8
        Z:gef9=<9!H4!F*4*8Z:gef9=<9*4!G*4wxvpir*<*8Z8i=66<
        5j*=!F*4*8Z:gef9=<9*F*F*=*4);F*4*8Z;<45i=e9*4!H*4w
        yfwxv*<*8Z8i=66<5j*G*4*8Z:gef9=<9*G*45*=!F*4*8Z9jg
        <5669!Hsvh*<*8Z;<45i=e9*=*F8!F*4*8Zg7j99hh8!Hglv*<
        *8Z9jg<5669*=!F*4*8Zj7gh<895*42!H*4*8Zg7j99hh8!F*4
        );H*4*8Z54h:7<gh!H*8Zj7gh<895!F*4mj*4*<*8Z54h:7<gh
        *4!H!H*4*6444*6*=*4);F*4);H*4ipwi*4);F*4mj*
      
          ...
    ?>
        

As you can see, CodeLock is fairly impressive for a pure PHP solution. At US$55.00, for a one-time, unlimited license, CodeLock v2.0 offers an excellent balance between price and relative security of your PHP source code.

Version 2.0 is a significant improvement over v1.5. Sporting an improved interface, Version 2.0 supports custom expiry messages, project-based encoding, multiple directory/file encoding, and the ability to encode partial script segments. Version 2.0 now offers time-delta and specific date expiry features as well.

A cool feature of v2.0 is the ability to encrypt a segment of your code. This is useful if you have a small project or a single class file that you want to encode. Although it is not as secure, it is still quite effective, and you don't need to install a decoder DLL for a single class library - which can be convenient in situations where decoder DLLs cannot be installed on the target server.

A user-callable API is available as an upgrade for Version 2.0 only. For an additional US$35.00, you can call CodeLock's encryption API from a PHP script to dynamically encode your scripts. This is useful if you wish to automate the encryption of your distribution package at "time of purchase".

With the CodeLock API, you can encrypt your package on the fly, with the client's Name, Business Name, Address, Country, IP Address or URL address, expiry and Unlock Key.

Table of Contents

  1. Introduction
  2. 3 Ways to Protect your Code: Obfuscate, Encrypt, Compile
  3. PHP Encoding Software
    1. Zend Guard
    2. SourceGuardian
    3. ionCube
    4. CodeLock
  4. Summary