A bytecode compiler with encryption
Bcompiler enables to encode your php scripts in bytecode, enabling you to protect the source code.
Short description could be found here
For install instructions see the manual.
You can download my version, modified within the terms of PHP license with encryption of compiled code optionally using mcrypt here(last) and a small HOWTO here and below.
Link to other download pages.
Maybe somebody will ask, why to use my version of bcompiler and why to use encryption for compiled php sources? Just because sometimes some values of variables are present as plain text in compiled source, that means for example, passwords to connect to databases or names of variables are not safe at all, is the answer.
Short installation manual
Extension could be loaded in php.ini or by dl().
- Extract content of bcompiler-0.8-mcrypt-1.tar.gz, bcompiler-0.9.1-mcrypt.tar.gz or
bcompiler-0.9.3-mcrypt.tar.gz file to ext directory of php sources.
- To use extension with encrypt/decrypt feature, uncomment a line below in bcompiler.c file(comented as default)
- Before compilation change default password/key in lines(two lines)
strcpy(key, "A_large_and_random_key_opened"); to yours(default 32 byte)
- If you are familiar with optional mcrypt, you can change values as "keysize", as well cipher modes, block modes, initialization vector definition algorithms or values, etc.
- On WIN32 copy libmcrypt.lib and php5ts.lib or php4ts.lib to ext\bcompiler. directory in PHP sources and instruct linker to use them or simple open bcompiler.dsp project.
On other systems also instruct linker to link libmcrypt.la "-L/$libpath $libpath/libmcrypt.la" with compiled sources. Or simple in $phpsources/ext/bcompiler directory run
make, make install
- Added function description:
bcompiler_encrypt_file(fh1,fh2) has two arguments as file handles. First as fh1 is input as compiled file, second as output as encrypted file handle.
PHP example cutout regarding description
$fp2 = fopen( "encrypted.php", "wb");
$fp1 = fopen( "compiled.php", "rb");
Mcrypt is covered by GNU General Public License as I know, which is not violated by my distribution or by my work, published on this page, as tutorial for optional implementation. If you don't agree with me, please let me know.
Matjaz Marcina "matjaz at marcina dot net"
Author: Matjaz Marcina 2009 within the terms of PHP license