当前位置: 首页 > 工具软件 > PHP Screw > 使用案例 >

php screw 密钥,php-screw php代码加密工具用法(整理)

何修能
2023-12-01

1、进入http://sourceforge.net/projects/php-screw/下载最新版本php_screw-1.5.tar.gz 解压安装: #tar zxf php_screw-1.5.tar.gz #cd php_screw-1.5 #vi php_screw.h 将 #define PM9SCREW “\tPM9SCREW\t” #define PM9SCREW_LEN 10 修改为任意字串,如: #define PM9SCREW “\tPHPENC\t” #define PM9SCREW_LEN 6 如果不改这个文件,加密的文件内容开头就会有 PM9SCREW,这么做是为了隐藏加密算法。 #vi my_screw.h 修改加密密钥: short pm9screw_mycryptkey[] = {11152, 368, 192, 1281, 62}; 修改为如: short pm9screw_mycryptkey[] = {12852, 968, 192, 1281, 62, 269}; 越长加密越可靠,建议不要大于5位数。 #phpize #./configure --with-php-config=/usr/bin/php-config #make 如果编译出错: /root/php_screw-1.5/php_screw.c: In function ‘zm_startup_php_screw’: /root/php_screw-1.5/php_screw.c:124: error: ‘struct _zend_compiler_globals’ has no member named ‘extended_info’ /root/php_screw-1.5/php_screw.c: In function ‘zm_shutdown_php_screw’: /root/php_screw-1.5/php_screw.c:133: error: ‘struct _zend_compiler_globals’ has no member named ‘extended_info’ make: *** [php_screw.lo] Error 1 修改: CG(extended_info) = 1; 为 CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO; 重新make  //在modules生成libscrew.so库 #cd tools #make   //生成screw工具 2、拷贝modules/php_screw.so到/usr/local/php_screw/modules/php_screw.so 配置/etc/php5/apache2/php.ini 添加: [phpScrew Loader] extension = /usr/local/php-screw/modules/php_screw.so 重启apache   /etc/init.d/apache2 restart 3、拷贝tools/screw到/usr/bin/screw 用法: 加密php文件: #screw info.php 加密成功后,info.php为加密后文件,新生成的info.php.screw为加密前文件。

 类似资料: