This article describes how to install and use php_screw. php_screw is another PHP code encryption implementation. it is similar to Zend's encoder. if you need it, refer to the following to clarify two questions: first, support for open source is not equal to opposed to code encryption; second, if you use something that is not your own (such as a company) to open source, it is even more difficult.
I used to know that Zend encoder is used for PHP code encryption. this is not only a commercial software, but it seems that it has been cracked, so we found an alternative solution -- php_screw, developed by a Japanese.
Php_screw is very small and has not carefully read its algorithm. However, you can modify the SEED and compile the so and executable files by yourself. You can even change the algorithm on your own. In any case, this encryption should be enough for our "ordinary people". if you really want to keep it open, do not disclose it. although the author does not say it is easy to crack, but where is the herd?
The installation environment must be PHP5.x, zlib enabled, autoconf, and automake installed.
Test Environment: Ubuntu 8.04 hard, PHP 5.2.3.
: Http://sourceforge.net/projects/php-screw/
1. decompress the package and change my_screw.h. the numbers in the package are SEED, which is equivalent to Passwords. you can change and increase the number at will, and the decryption speed is not affected.
2. Compile the so File:
The code is as follows:
$ Phpize
$./Configure
$ Make
If this error occurs, it is because autoconf is not installed:
The code is as follows:
$ Make
Make: *** No targets specified and no makefile found. Stop.
3. install the so File. Compile the file in the modules directory and copy it to the location where php extension is stored, such as/usr/lib/php5/20060613 + lfs, then in php. added in ini:
The code is as follows:
Extension = php_scresponso
4. Compile the executable file used to encrypt the file:
The code is as follows:
$ Cd tools
$ Make
The newly generated screw under the tools directory can be called after it is put in $ PATH. for example, to encrypt a file:
The code is as follows:
$ Screw a. php
Success Crypting (a. php)
The encrypted a. php file runs normally. at the same time, screw will change the unencrypted file to the. screw file as a backup.
Update @ 2008-09-01
After encryption, there is a small problem. when you use require or include to reference the encryption code under include_path, it will be cited as plaintext. There are two solutions:
Use the absolute path to reference the encrypted content stored in include_path. if it is your host, it will certainly be okay;
Reference using relative paths, such as in the sub-directory of the project.