Encryption Software (PHP_SCREW)
"Download website:http://sourceforge.net/projects/php-screw/
Description:php files are usually stored in text format on the server side, it is easy for others to read the source code, in order to
Source code can be used to encrypt the source code. Two parts are required to implement this function
One is: Encryption program, to achieve the encryption of PHP files
The other is: parse the encrypted PHP file to get the result. The realization of the former is relatively simple
Single, is just a procedure. Most of the latter implementations are implemented in the form of PHP module.
"Php_screw (screw) can achieve the above functions. The latest version is 1.5 and can be downloaded from sourceforge.
"Php_screw is a Japanese-developed PHP encryption program, but only runs under Linux
Installation
Description: The purpose of the installation is actually to produce two files, one is used to encrypt PHP files screw, another
PHP-loaded parsing module php_screw.so
Installation Environment
System: CentOS 5.3
Software: Apache 2.2.9
PHP 5.2.10
The above environment is all installed by their own download configuration. For specific Apache+php+mysql installation methods, please search online.
Installation
1. Unzip the TAR-ZXVF php_screw-1.5.tar.gz with tar
2. Enter the php_screw-1.5 directory to start the installation
CD php_screw-1.5
Phpize
As for the phpize, it is just the Php5-dev module installed in the Php5-dev expansion module.
./confiugre
3. Set the password you use to encrypt
Copy the code code as follows:
VI my_screw.h
--The Encryption SEED key (Pm9screw_mycryptkey) into the
Values according to.
The encryption would be a harder to break and if you add more values to the
Encryption SEED Array. However, the size of the SEED is unrelated to
The time of the decrypt processing.
* If You can read and understand the source code, to modify an original
Encryption logic would be possible. It is should not
be necessary.
optional:encrypted scripts get a stamp added to the beginning of the
File. If you like, stamp defined by
Pm9screw and Pm9screw_len in Php_screw.h. Pm9screw_len must
be less than or equal to the size of pm9screw.
4. Compiling
Make
5. Copy the php_screw.so file under the modules directory to the/usr/lib/php5/extension directory
CP modules/php_screw.so/usr/lib/php5/extension/
6. Edit the php.ini file
In the php.ini file, add the following statement
Extension=php_screw.so
7. Restart Apache
/srv/apache/bin/apachectl restart
8. Compile the encryption tool
CD Tools
Make
9. Copy the tool screw in the tools directory to the appropriate directory
CP screw/usr/bin/
After the above 10 steps, the php_screw-1.5 has been installed all completed. And now PHP has supported the interpretation of encrypted PHP files.
Use
1. now write a PHP file to encrypt.
I wrote the following test.php file for testing php speed
Copy the code code as follows:
<?
$a = 0;
$t =time ();
for ($i =0; $i <5000000; $i + +)
{$a = $a * $i;}
$t 1=time ();
echo "<p>";
echo "It used:";
echo $t 1-$t;
echo "seconds";
?>
Place the above test.php file in the/var/www/directory. Browser access will show the speed of PHP in a large number of calculations (rough estimate)
2. Encrypt the php file we wrote
cd/var/www/
Screw test.php
After we encrypt, now the directory of the test.php file is we have encrypted. And the source file was renamed Test.php.screw stored.
Now let's test the test.php to see if we can use it properly. How fast?
I compared a bit, the speed before and after the encryption is probably the same, basically not too much loss.
3. Batch encrypted files
In Debian, Apache2, PHP5, after testing the. html file encryption, the correct parsing can be done;
Php_screw How to encrypt the file under the current directory, the files contained in the directory, and the files contained in the directory
find./-name "*.php" -print|xargs-n1 Screw//Encrypt all. php files
find./-name "*.screw"-print/xargs-n1 RM// Delete all backup files for. php Source Files
This will encrypt all the. php files in the current directory.
PHP Source code Encryption