php代码加密-yakpro

1,497次阅读
没有评论

一.技术方案:

php-obfusactor开源免费,混淆型免扩展加密,较类似Android上的ProGuard。

yakpro-po:开源免费,混淆型免扩展加密,打乱了程序的运行流程。

Z5加密商业,虚拟机型免扩展加密,Z-Blog团队出品。

Swoole Compiler:商业,有扩展加密,Swoole官方出品。

参考文档

https://www.anquanke.com/post/id/176767(PHP代码加密面面观)

https://github.com/pk-fr/yakpro-po

二. yak安装日志:

## Setup:

Note: This setup is also valid for Windows 10 Anniversary with bash installed…

1. Prerequisites: git and php-cli (command line interface) packages.

on ubuntu: (adapt according your linux distribution)

# apt install git

# apt install php-cli

do not forget to install all other php modules that you are using within your software:

for example: apt install php-mysql if you are using mysql…

2. Navigate to the directory where you want to install yakpro-po (/usr/local is a good idea):

# cd /usr/local

3. Then retrieve from GitHub:

# git clone https://github.com/pk-fr/yakpro-po.git

4. Go to the yakpro-po directory:

# cd yakpro-po

5. Then retrieve from GitHub:

# git clone https://github.com/nikic/PHP-Parser.git

6. Check that yakpro-po.php has execute rights, otherwise:

# chmod a+x yakpro-po.php

7. Create a symbolic link in the /usr/local/bin directory

# cd /usr/local/bin

# ln -s /usr/local/yakpro-po/yakpro-po.php yakpro-po

8. You can now run yakpro-po

# yakpro-po –help

# yakpro-po test.php

Modify a copy of the yakpro-po.cnf to fit your needs…

Read the “Configuration file loading algorithm” section of this document

to choose the best location suiting your needs!

That’s it! You’re done!

####

安装备注: 阅读yak包中的README.md 按步骤操作即可.如果git clone不下来, 直接下载zip 解压即可.

## Usage:

`yakpro-po`

Obfuscates according configuration file!

(See configuration file loading algorithm)

`yakpro-po source_filename`

Obfuscates code to stdout

`yakpro-po source_filename -o target_filename`

Obfuscates code to target_filename

`yakpro-po source_directory -o target_directory`

Recursivly obfuscates code to target_directory/yakpro-po (creates it if it does not already exist).

`yakpro-po –config-file config_file_path`

According to config_file_path.

`yakpro-po –clean`

Requires target_directory to be present in your config file!

Recursivly removes target_directory/yakpro-po

示例: 

yakpro 安装位置:  ~/yakpro-po/

默认配置文件: ~/yakpro-po/yakpro-po.cnf 不建议修改,更新代码会覆盖. 可复制配置文件到一个特定的conf目录下.

例如创建混淆代码目录: ~/test-yak/, 配置文件:  ~/test-yak/config/sp-api.cnf

配置文件修改:

分类: 1.普通变量 2.常量 3.函数 4.类名 5.类成员 6.类方法 7.类常量 

可加密: 普通变量 常量 类成员 类常量 设置为true

不可加密: 函数  类名 类方法 设置为false,

        原因: 1. 由于项目已经建立,类名和类方法的加密修改,会改变接口路由名称,所以不建议加密. 或者修改路由 并 解决加密后类名和文件名不同步的加载问题即可.

                 2. 由于函数和类方法,常常代码中有写死函数名调用的地方,加密后会造成调用找不到的错误, 所以不建议加密.

参考配置如下:

$conf->obfuscate_constant_name            = true; // self explanatory

$conf->obfuscate_variable_name             = true; // self explanatory

$conf->obfuscate_function_name             = false; // self explanatory

$conf->obfuscate_class_name                 = false; // self explanatory

$conf->obfuscate_interface_name           = false; // self explanatory

$conf->obfuscate_trait_name                   = false; // self explanatory

$conf->obfuscate_class_constant_name = true; // self explanatory

$conf->obfuscate_property_name           = true; // self explanatory

$conf->obfuscate_method_name            = false; // self explanatory

$conf->obfuscate_namespace_name     = false; // self explanatory

$conf->obfuscate_label_name                = true; // label: , goto label; obfuscation

$conf→obfuscate_if_statement               = true; // obfuscation of if else elseif statements

$conf->obfuscate_loop_statement          = true; // obfuscation of for while do while statements

$conf->obfuscate_string_literal               = true; // pseudo-obfuscation of string literals

$conf->source_directory = ‘/xxx/sp-api’; // self explanatory

$conf->target_directory  = ‘/xxx/test-yak/sp-api’; // self explanatory

常用操作如下:

创建配置文件位置: ~/test-yak/config/sp-api.cnf

cd ~/test-yak

yakpro-po –config-file ./config/sp-api.cnf                  加密整个sp-api项目

yakpro-po –clean –config-file ./config/sp-api.cnf      清除所有加密

正文完
可以使用微信扫码关注公众号(ID:xzluomor)
post-qrcode
 0
评论(没有评论)

文心AIGC

2023 年 11 月
 12345
6789101112
13141516171819
20212223242526
27282930  
文心AIGC
文心AIGC
人工智能ChatGPT,AIGC指利用人工智能技术来生成内容,其中包括文字、语音、代码、图像、视频、机器人动作等等。被认为是继PGC、UGC之后的新型内容创作方式。AIGC作为元宇宙的新方向,近几年迭代速度呈现指数级爆发,谷歌、Meta、百度等平台型巨头持续布局
文章搜索
热门文章
潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026

潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026

潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026 Jay 2025-12-22 09...
面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25

面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25

面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25 鹭羽 2025-12-13 22:37...
钉钉又发新版本!把 AI 搬进每一次对话和会议

钉钉又发新版本!把 AI 搬进每一次对话和会议

钉钉又发新版本!把 AI 搬进每一次对话和会议 梦晨 2025-12-11 15:33:51 来源:量子位 A...
5天连更5次,可灵AI年末“狂飙式”升级

5天连更5次,可灵AI年末“狂飙式”升级

5天连更5次,可灵AI年末“狂飙式”升级 思邈 2025-12-10 14:28:37 来源:量子位 让更大规...
商汤Seko2.0重磅发布,合作短剧登顶抖音AI短剧榜No.1

商汤Seko2.0重磅发布,合作短剧登顶抖音AI短剧榜No.1

商汤Seko2.0重磅发布,合作短剧登顶抖音AI短剧榜No.1 十三 2025-12-15 14:13:14 ...
最新评论
ufabet ufabet มีเกมให้เลือกเล่นมากมาย: เกมเดิมพันหลากหลาย ครบทุกค่ายดัง
tornado crypto mixer tornado crypto mixer Discover the power of privacy with TornadoCash! Learn how this decentralized mixer ensures your transactions remain confidential.
ดูบอลสด ดูบอลสด Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
Obrazy Sztuka Nowoczesna Obrazy Sztuka Nowoczesna Thank you for this wonderful contribution to the topic. Your ability to explain complex ideas simply is admirable.
ufabet ufabet Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
ufabet ufabet You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
ufabet ufabet Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
热评文章
读懂2025中国AI走向!公司×产品×人物×方案,最值得关注的都在这里了

读懂2025中国AI走向!公司×产品×人物×方案,最值得关注的都在这里了

读懂2025中国AI走向!公司×产品×人物×方案,最值得关注的都在这里了 衡宇 2025-12-10 12:3...
5天连更5次,可灵AI年末“狂飙式”升级

5天连更5次,可灵AI年末“狂飙式”升级

5天连更5次,可灵AI年末“狂飙式”升级 思邈 2025-12-10 14:28:37 来源:量子位 让更大规...
戴尔 x OpenCSG,推出⾯向智能初创企业的⼀体化 IT 基础架构解决方案

戴尔 x OpenCSG,推出⾯向智能初创企业的⼀体化 IT 基础架构解决方案

戴尔 x OpenCSG,推出⾯向智能初创企业的⼀体化 IT 基础架构解决方案 十三 2025-12-10 1...
九章云极独揽量子位三项大奖:以“一度算力”重构AI基础设施云格局

九章云极独揽量子位三项大奖:以“一度算力”重构AI基础设施云格局

九章云极独揽量子位三项大奖:以“一度算力”重构AI基础设施云格局 量子位的朋友们 2025-12-10 18:...
乐奇Rokid这一年,一路狂飙不回头

乐奇Rokid这一年,一路狂飙不回头

乐奇Rokid这一年,一路狂飙不回头 梦瑶 2025-12-10 20:41:15 来源:量子位 梦瑶 发自 ...