Use the Php_screw encryption PHP program instance detailed

Source: Internet
Author: User
Tags install php ini php file php source code phpinfo centos zend

Php_screw is a free PHP source code for the encryption of PHP extensions, can be customized to encrypt the seed file, encrypted file efficiency will not be reduced, currently has not been cracked. Here's how to install and use this

The latest version is php_screw_1.5
wget http://nchc.dl.sourceforge.net/project/php-screw/php-screw/1.5/php_screw-1.5.tar.gz

The official site can only be down to the source
Download the latest version from the official site:
http://sourceforge.net/project/showfiles.php?group_id=52025

Installation steps:
1. Download Source:
wget http://nchc.dl.sourceforge.net/project/php-screw/php-screw/1.5/php_screw-1.5.tar.gz

2. Decompression:
tar zxvf php_screw_1.5.tar.gz

3. The Readme.en file allows you to see that this version of the package requires a php5.x environment and requires zlib support (checked by executing scripts). If you are using the php4.x version, please download the php_screw_1.3 version

4. Enter source directory
#cd php_screw_1.5
root@server:~/php_screw-1.5# vim php_screw.h
# Define Pm9screw "TPM9SCREWT"
#define Pm9screw_len
#define PM9SCREW "Tlaurencet"
#define Pm9screw_len 9

5. php_screw.h file, if you do not change this file, you encrypt the contents of the file will have the beginning of the pm9screw, you copy to Google search to know is to use the Screw module encryption, although the current online did not find decryption algorithm, But later not necessarily, this is to hide the encryption algorithm, you can let others do not know you are using what algorithm plus the secret. Change to cool after 10 also to change to 6. Because after the Laurence character length is 9 characters, if you do not correspond to encryption after decryption resolution.
My_screw.h
root@server:~/php_screw-1.5# vim my_screw.h
Short pm9screw_mycryptkey[] = {
11152, 368, 192, 1 281,
};
Short pm9screw_mycryptkey[] = {
12852, 968,, 1281, N, MB
};
Custom encryption seed file, this may be the highlight of the program, with your favorite text editor open source directory My_screw.h, modify the file inside the array file, you can add the length of the array in numbers. The longer the array, the more reliable the encryption. And the length of the array does not affect the speed of encryption and the execution of your PHP program. Test found that not more than 5 digits, large will decrypt the problem of parsing.

6. Phpize
#phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519

If your system prompts you without the command you need to install Apt-get install Php5-dev Centos is yum-y install Php5-devel, if you are prompted that the above command does not exist, It may be that your PHP is not installed in the standard directory, please go to the PHP installation directory in the Bin folder to find out if there is a file. Then go back to the php_scre_1.5 directory and execute
#/full/path/to/phpize
Autoconf and M4 packages are required to successfully execute phpize. After successful execution, the Configure file appears under the source folder
If no errors are installed as follows: Phpize command not found
Solution: Centos:yum-y Install Php-devel
: Rhel:up2date-i Php-devel

7. Configure
./configure
if PHP is installed in a nonstandard directory, you need to see if there are any php-config files in the Phpize directory, and then execute the directory below
./configure –with-php-config=/full/path/to/php-config

8. Installation
make
make install

At this time there is sometimes a problem:
' Zend_compiler_globals ' does not have a member named ' Extended_info ' Make: * * * [Php_screw.lo] Error 1
Workaround:
Need to modify PHP_SCREW.C (there are two places to adjust)
Put CG (Extended_info) = 1;
Modified to:
CG (compiler_options) |= zend_compile_extended_info;

9. PHP Configuration
Add extensions to php.ini files
Vim/usr/local/php/etc/php.ini
Extension=php_screw.so
Restart Apache to see Phpinfo () There should be php_screw information

10. Go to the Tools directory under the source directory
#make
here is compiled PHP source code to the PHP Encrypting File Tool: Screw

The above process has already installed the Php_screw, below to see how to encrypt:
1. Switch to your PHP source directory, such as you want to encrypt the phpinfo.php file is executed
#screw phpinfo.php

2. php_screw_1.5 has a disadvantage is that screw encryption tool can only execute one file at a time, if you switch to your PHP source directory execution
#screw *
will not have any files are encrypted, if you want to encrypt hundreds of files, it is a disaster
The workaround is to perform the
Find/data/php/source-name "*.php"-print|xargs-n1 screw//Encrypt all. php files
Find/data/php/source-name "* . Screw "-PRINT|XARGS-N1 RM//delete all. PHP Source files backup file
can encrypt all suffixes in the/path/to/php/source directory to PHP, including subdirectories.
This is basically the encryption of the PHP source code. If just a personal small program source code encryption, I think Php_screw is a good choice

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.