一、下载php-beast 登录ssh
wget https://github.com/liexusong/php-beast/archive/master.zip

使用php-beast扩展给php源码加密

 

解压:unzip master.zip

使用php-beast扩展给php源码加密

 

进入解压目录:cd php-beast-master

 

查找php目录下phpize文件并执行它。
执行phpize安装扩展模块 : /www/server/php/71/bin/phpize

使用php-beast扩展给php源码加密

 

找到php-config文件并配置,--enable-beast-debug若无需解密文件则不配置

加载配置 ./configure  --with-php-config=/www/server/php/71/bin/php-config --enable-beast-debug

使用php-beast扩展给php源码加密

 

编译:sudo make && make install

使用php-beast扩展给php源码加密

 记住编译后文件夹位置在下面找beast.so文件。

 使用php-beast扩展给php源码加密

使用php-beast扩展给php源码加密

添加扩展,在php.ini中加入:extension= /www/server/php/71/lib/php/extensions/no-debug-non-zts-20160303/beast.so

最后重载配置。

使用beast_encode_file()函数加密文件
beast_encode_file(string $input_file, string $output_file, int expire_timestamp, int encrypt_type)

1. $input_file: 要加密的文件
2. $output_file: 输出的加密文件路径
3. $expire_timestamp: 文件过期时间戳
4. $encrypt_type: 加密使用的算法(支持:BEAST_ENCRYPT_TYPE_DES、BEAST_ENCRYPT_TYPE_AES)

 

另外你还可以对扩展进行简单配置,让你的加密更加安全。配置项如下:

 修改该签名隐藏加密方式

使用php-beast扩展给php源码加密

 

 加上网卡号,使加密后的PHP代码只能在该网卡下的服务器运行

使用php-beast扩展给php源码加密

 

 

 修改加密key使加密后的文件解密难度加大

使用php-beast扩展给php源码加密

使用php-beast扩展给php源码加密

 

相关文章:

  • 2021-09-05
  • 2021-07-24
  • 2021-05-22
  • 2022-02-14
猜你喜欢
  • 2021-12-29
  • 2021-05-15
  • 2021-12-03
  • 2022-12-23
  • 2021-06-01
  • 2021-08-05
相关资源
相似解决方案