php代码加密-yakpro

1,549次阅读
没有评论

一.技术方案:

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、百度等平台型巨头持续布局
文章搜索
热门文章
清库存!DeepSeek突然补全R1技术报告,训练路径首次详细公开

清库存!DeepSeek突然补全R1技术报告,训练路径首次详细公开

清库存!DeepSeek突然补全R1技术报告,训练路径首次详细公开 Jay 2026-01-08 20:18:...
2025最大AI赢家的凡尔赛年度总结,哈萨比斯Jeff Dean联手执笔

2025最大AI赢家的凡尔赛年度总结,哈萨比斯Jeff Dean联手执笔

2025最大AI赢家的凡尔赛年度总结,哈萨比斯Jeff Dean联手执笔 鹭羽 2025-12-24 09:1...
AI Coding新王登场!MiniMax M2.1拿下多语言编程SOTA

AI Coding新王登场!MiniMax M2.1拿下多语言编程SOTA

AI C++oding新王登场!MiniMax M2.1拿下多语言编程SOTA 克雷西 2025-12-24 ...
智能体落地元年,Agent Infra是关键一环|对话腾讯云&Dify

智能体落地元年,Agent Infra是关键一环|对话腾讯云&Dify

智能体落地元年,Agent Infra是关键一环|对话腾讯云&Dify 鹭羽 2025-12-23 1...
最新评论
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.
热评文章
易烊千玺的华为绿手机,真的AI了

易烊千玺的华为绿手机,真的AI了

Failed to fetch content Read More 
AI狼人杀大决战!GPT、Qwen、DeepSeek大乱斗,人类高玩汗流浃背

AI狼人杀大决战!GPT、Qwen、DeepSeek大乱斗,人类高玩汗流浃背

AI狼人杀大决战!GPT、Qwen、DeepSeek大乱斗,人类高玩汗流浃背 鹭羽 2025-12-23 14...
长城首个VLA车型发布,魏建军回应「赌上姓氏造车」

长城首个VLA车型发布,魏建军回应「赌上姓氏造车」

长城首个VLA车型发布,魏建军回应「赌上姓氏造车」 贾浩楠 2025-12-23 13:57:25 来源:量子...