网站首页 > 技术教程 正文
介绍
一个简洁、高性能、跨平台的 PHP7 代码加密扩展
特点
简单快速,经实测,几乎不影响性能
兼容 OPcache、Xdebug 等其他扩展
支持 Linux、macOS、Windows 等系统
兼容 Apache、Nginx + PHP-fpm、命令行等运行模式
加密算法较简单,这是出于速度考虑,但仍不易解密
若项目的 php 文件很多,可只加密部分重要代码
要求 PHP >= 7.0
安装
编译前请在 core.h 中做如下修改:
/* 这里定制你的加密特征头,不限长度,十六进制哦 */
const u_char tonyenc_header[] = {
0x66, 0x88, 0xff, 0x4f,
0x68, 0x86, 0x00, 0x56,
0x11, 0x16, 0x16, 0x18,
};
/* 这里指定密钥,设置长一些更安全 */
const u_char tonyenc_key[] = {
0x9f, 0x49, 0x52, 0x00,
0x58, 0x9f, 0xff, 0x21,
0x3e, 0xfe, 0xea, 0xfa,
0xa6, 0x33, 0xf3, 0xc6,
};
在 Linux、macOS 上编译
git clone https://github.com/lihancong/tonyenc.git
cd tonyenc
phpize
./configure
make
将编译好的文件 modules/tonyenc.so 加入到配置项 extension=tonyenc.so ,重启 PHP 服务
在 Windows 上编译
已编译了以下模块,可供测试(需要 VC14 运行库):
# php7.0 64位 线程安全版
php_tonyenc_php70_ts_VC14_x64.dll
# php7.0 64位 线程非安全版
php_tonyenc_php70_nts_VC14_x64.dll
手动编译方法
加密
代码中的 tonyenc.php 是加密工具:
php tonyenc.php example.php dir/
这样即可加密 example.php 和 dir 目录下的所有 php 文件,PHP 在运行它们时会自动解密,够简单吧。
猜你喜欢
- 2024-10-15 「漏洞预警」PHP 远程代码执行漏洞
- 2024-10-15 PHP-FPM 学习记录(php-fpm原理)
- 2024-10-15 LNMP的并发配置(lnmp集群)
- 2024-10-15 解决PHP进程 CPU 100%——file_get_contents惹的祸
- 2024-10-15 无孔不入:NextCry勒索病毒利用PHP最新漏洞攻击传播
- 2024-10-15 PHP日志记录(php-fpm 日志)
- 2024-10-07 php+apache 和 php+nginx的区别(php和nginx的关系)
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)