Before you begin, there are two things to clarify: first, support for open source is not equal to opposing code encryption; second, if you take something that is not your own (for example, a company) to open source, it should not be.
Previously known, PHP code encryption is the use of Zend Encoder, this thing is not only commercial software, as if also burst out of the problem can be cracked, so they found an alternative to the program ────php_screw, a Japanese development dongdong.
Php_screw is very compact and has not looked at its algorithm carefully, but from the documentation, you can change the seed itself, and then compile the so and executable files yourself. If it's enough, you can even change the algorithm yourself. Anyway, for us "ordinary people", this kind of encryption should be enough, if you really want to be watertight, it is still not public good, although the author said is not very easy to crack, but it does not mean where there are cattle?
Installation of the environment needs: Php5.x,zlib Open, Autoconf,automake has been installed.
Test environment: Ubuntu 8.04 Hardy, PHP 5.2.3.
Download Address: http://sourceforge.net/projects/php-screw/
1, decompression, change my_screw.h, inside a few numbers is seed, equivalent to the password, you can change, increase, and the number of numbers does not affect the speed of decryption.
2, compile so file:
Copy Code code as follows:
$ phpize
$./configure
$ make
If this error occurs, it is because the autoconf is not installed:
Copy Code code as follows:
$ make
Make: * * * No targets specified and no makefile found. Stop.
3, installation so file, compile the file in the modules directory, copy it to the location of the PHP extension storage, such as/usr/lib/php5/20060613+lfs, and then add in php.ini:
Copy Code code as follows:
4. Compile the executable file used to encrypt the file:
Copy Code code as follows:
The newly generated screw in the tools directory is the one that can be invoked in $path, such as encrypting a file:
Copy Code code as follows:
$ screw a.php
Success crypting (a.php)
The encrypted a.php performs properly, while screw also renames the file that was not previously encrypted as a backup. screw file.
Update @ 2008-09-01
After encryption, there is a small problem, the use of require or include reference in the Include_path under the encryption code, as the clear text, the solution has two ways:
Using an absolute path reference to the encrypted content under the include_path, if it is their own host, certainly no problem;
Use relative paths to refer to, such as in the subdirectory of this project, which is fine.