Use phpscrew for source code encryption

Source: Internet
Author: User
Use phpscrew for source code encryption. my installation environment system: Slackware10 software: Apache1.3.31PHP4.3.7 and above are all built-in after slackware10 is installed by default. For details about how to install Apache + php + mysql, refer to the following Apac that supports php to use php screw for source code encryption:
My installation environment
System: Slackware 10
Software: Apache 1.3.31
PHP 4.3.7
All of the above environments are provided after slackware 10 is installed by default. The specific installation method of Apache + php + mysql is as follows:
Support installation of Apache environment in php
Install
1. put the obtained php_screw-1.3.tgz file in the/usr/local directory and decompress it with tar
Tar zxvf php_screw-1.3.tgz

2. go to the/usr/local/php_screw-1.3 directory to start installation
1cd/usr/local/php_screw-1.3
2 phpize
3./configure

3. set your own password for encryption
Vi my_screw.h

-- Please change the encryption SEED key (pm9screw_mycryptkey) into
Values according to what you like.
The encryption will be harder to break, if you add more values to
Encryption SEED array. However, the size of the SEED is unrelated
The time of the decrypt processing.

* If you can read and understand the source code, to modify an original
Encryption logic will be possible. But in general, this shocould not
Be necessary.

OPTIONAL: Encrypted scripts get a stamp added to the beginning of
File. If you like, you may change this stamp defined
PM9SCREW and PM9SCREW_LEN in php_scre1_h. PM9SCREW_LEN must
Be less than or equal to the size of PM9SCREW.

4. Compile
Make

5. copy the php_scresponso file under the modules directory to the/usr/lib/php/extension directory.
Cp modules/php_scresponso/usr/lib/php/extension/

6. edit the php. ini file.
Add the following statement to the php. ini file:
Extension = php_scresponso

7. restart Apache
/Etc/rc. d/rc. httpd restart

8. Compile the encryption tool
Cd tools
Make

9. copy the tool screw used for encryption under the tools directory to the appropriate directory.
Cp screw/usr/bin/

After the above 10 steps, the php_screw-1.3 has been fully installed. Now, php supports interpreting encrypted php files.
Use
1. write a php file to be encrypted.
I wrote the following compute. php file to test the php speed.
01 02 $ a = 0;
03 $ t = time ();
04for ($ I = 0; I I <5000000; $ I ++)
05 {$ a = $ a * $ I ;}
06 $ t1 = time ();
07 echo"

";
08 echo "It used :";
09 echo $ t1-$ t;
10 echo "seconds ";
11?>

Put the above compute. php file in the/var/www/htdocs directory. Access through a browser will show the speed of php in a large amount of computing (only a rough estimate)
2. encrypt the php file we wrote.
Cd/var/www/htdocs/
Screw compute. php

After encryption, the compute. php file in the directory is encrypted. The source file is renamed compute. php. screw and stored.
Now let's test compute. php to see if it can be used normally? Speed?
I have compared it. the speed before and after encryption is roughly the same, and there is basically not much loss.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.