Deprecated
: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in
/www/wwwroot/testblog.58heshihu.com/var/Widget/Archive.php
on line
1057
首页
关于
Search
1
给你10个市场数据调研报告的免费下载网站!以后竞品数据就从这里找!
182 阅读
2
php接口优化 使用curl_multi_init批量请求
144 阅读
3
《从菜鸟到大师之路 ElasticSearch 篇》
107 阅读
4
2024年备考系统架构设计师
104 阅读
5
PHP 文件I/O
92 阅读
php
thinkphp
laravel
工具
开源
mysql
数据结构
总结
思维逻辑
令人感动的创富故事
读书笔记
前端
vue
js
css
书籍
开源之旅
架构
消息队列
docker
教程
代码片段
redis
服务器
nginx
linux
科普
java
c
ElasticSearch
测试
php进阶
php基础
登录
Search
标签搜索
php函数
php语法
性能优化
安全
错误和异常处理
问题
vue
Composer
Session
缓存
框架
Swoole
api
并发
异步
正则表达式
php-fpm
mysql 索引
开发规范
协程
dafenqi
累计撰写
786
篇文章
累计收到
28
条评论
首页
栏目
php
thinkphp
laravel
工具
开源
mysql
数据结构
总结
思维逻辑
令人感动的创富故事
读书笔记
前端
vue
js
css
书籍
开源之旅
架构
消息队列
docker
教程
代码片段
副业
redis
服务器
nginx
linux
科普
java
c
ElasticSearch
测试
php进阶
php基础
页面
关于
搜索到
2
篇与
的结果
2023-08-09
php 加密解密小程序
php 加密解密小程序php 加密解密小程序,按键盘顺序重新排序字母表$subject=$_GET['s']; $replace = ['a'=>'q','b'=>'w','c'=>'e','d'=>'r','e'=>'t','f'=>'y','g'=>'u','h'=>'i','i'=>'o','j'=>'p','k'=>'a', 'l'=>'s','m'=>'d','n'=>'f','o'=>'g','p'=>'h','q'=>'j','r'=>'k','s'=>'l','t'=>'z','u'=>'x', 'v'=>'c','w'=>'v','x'=>'b','y'=>'n','z'=>'m']; $encrypt=strtr($subject, $replace); $decrypt=strtr($encrypt, array_flip($replace)); echo '加密:'.$encrypt; echo '解密:'.$decrypt; //输入abcdefg //输出 加密:qwertyu解密:abcdefg
2023年08月09日
14 阅读
0 评论
0 点赞
2023-08-08
使用php blenc扩展加密php源代码
使用php blenc扩展加密php源代码使用php blenc扩展加密php源代码,不但可以加密源代码,还可以设置过期时间。扩展地址 http://pecl.php.net/package/blenc注意:不要启用opcache扩展,否则加密后的代码无法正常运行。要加密的源码不需要<?php 及?>开始与结束标记可指定个人密钥。可指定一个BLENC模块过期日期。 你可以决定BLENC 模块将工作到一个日期。之后,BLENC不会解密任何文件.这些都可以在头文件 blenc_protect.h中设置,设置好后再编译BLENC.用法:http://cn2.php.net/manual/en/function.blenc-encrypt.php安装用phpize安装 phpize ./configure make make install.注意,如果安装后,访问php出现500错误,请试着打开 php.ini中的expose_php=On;安装扩展后,要使以下文件可写:/usr/local/etc/blenckeys具体加密用法文件:<?php$file='en.php';$file_name = basename($file);$unencrypted_key='itvyyb';$source_code = file_get_contents($file);$html='';const TARGET_DIR='/Library/WebServer/Documents/';//This covers old-asp tags, php short-tags, php echo tags, and normal php tags.$contents = preg_replace(array('/^<(\?|\%)\=?(php)?/', '/(\%|\?)>$/'), array('',''), $source_code);//echo $contents;exit;$html .= "<br> BLENC blowfish unencrypted key: $unencrypted_key" . PHP_EOL;$html .= "<br> BLENC file to encode: " . $file_name . PHP_EOL;//file_put_contents('blencode-log', "---\nFILE: $file_name\nSIZE: ".strlen($contents)."\nMD5: ".md5($contents)."\n", FILE_APPEND);$redistributable_key = blenc_encrypt($contents, TARGET_DIR . '/blenc/' . $file_name, $unencrypted_key);$html .= "<br> BLENC size of content: " . strlen($contents) . PHP_EOL;/**Server keykey_file.blenc*/file_put_contents(TARGET_DIR . '/blenc/' . 'key_file.blenc', $redistributable_key . PHP_EOL);$html .= " BLENC redistributable key file key_file.blenc updated." . PHP_EOL;exec("cat key_file.blenc >> /usr/local/etc/blenckeys");echo $html;?>另一个php加密扩展https://github.com/liexusong/php-beast和这个差不多。php-beast 加密代码使用方法如下,在cli下运行<?phpfunction getext($file) {$list = explode('.', $file);return strtolower($list[count($list)-1]);}function encrypt_project($project, $new_project) {$project = rtrim($project, '/');$new_project = rtrim($new_project, '/');if (!file_exists($new_project)) {if (!mkdir($new_project)) {printf("[failed] failed to call `mkdir()' function\n");return false;}}$hdl_o = opendir($project);$hdl_n = opendir($new_project);if (!$hdl_o || !$hdl_n) {if ($hdl_o) closedir($hdl_o);if ($hdl_n) closedir($hdl_n);printf("[failed] failed to call `opendir()' function\n");return false;}while (($file = readdir($hdl_o)) !== false) {if ($file == '.' || $file == '..') {continue;}$path = $project.'/'.$file;if (is_dir($path)) {encrypt_project($path, $new_project.'/'.$file);} elseif (is_file($path) && getext($file) == 'php') {beast_encode_file($path, $new_project.'/'.$file);} else {copy($path, $new_project.'/'.$file);}}closedir($hdl_o);closedir($hdl_n);return true;}$stdin = fopen("php://stdin", "r");$stdout = fopen("php://stdout", "w");if (!$stdin || !$stdout) {if ($stdin) fclose($stdin);if ($stdout) fclose($stdout);exit("[failed] failed to open I/O stream\n");}fwrite($stdout, "Please enter project path: ");$project = fgets($stdin);$project = trim($project);fwrite($stdout, "Please enter output project path: ");$new_project = fgets($stdin);$new_project = trim($new_project);$start = time();fwrite($stdout, "Encrypting...\n");encrypt_project($project, $new_project); / encrypt project /$spend = time() - $start;fwrite($stdout, "Finish encrypt, spend {$spend} seconds.\n");?>good:<?php/**FileName: encrypt_project.phpDesc: php源码加密Author: LenixEmail: yangyb@itv.cnHomePage: http://www.itv.com.cnVersion: 1.0LastChange: 2015-08-03 13:34:56History:*/function getext($file) {$list = explode('.', $file);return strtolower($list[count($list)-1]);}function encrypt_project($project, $new_project) {$unencrypted_key='itvyyb';//个人密钥$project = rtrim($project, '/');$new_project = rtrim($new_project, '/');if (!file_exists($new_project)) {if (!mkdir($new_project)) {printf("错误,不能调用 `mkdir()' 函数\n");return false;}}$hdl_o = opendir($project);$hdl_n = opendir($new_project);if (!$hdl_o || !$hdl_n) {if ($hdl_o) closedir($hdl_o);if ($hdl_n) closedir($hdl_n);printf("错误,不能调用`opendir()' 函数\n");return false;}while (($file = readdir($hdl_o)) !== false) {if ($file == '.' || $file == '..') {continue;}$path = $project.'/'.$file;if (is_dir($path)) {encrypt_project($path, $new_project.'/'.$file);} elseif (is_file($path) && getext($file) == 'php') {$source_code = file_get_contents($path);$contents = preg_replace(array('/^<(\?|\%)\=?(php)?/', '/(\%|\?)>$/'), array('',''), $source_code);$redistributable_key = blenc_encrypt($contents, $new_project.'/'.$file, $unencrypted_key);file_put_contents( 'key_file.blenc', $redistributable_key . PHP_EOL);$dir=dirname(__FILE__);exec("cat $dir/key_file.blenc >> /usr/local/etc/blenckeys");} else {copy($path, $new_project.'/'.$file);}}closedir($hdl_o);closedir($hdl_n);return true;}$stdin = fopen("php://stdin", "r");$stdout = fopen("php://stdout", "w");if (!$stdin || !$stdout) {if ($stdin) fclose($stdin);if ($stdout) fclose($stdout);exit("错误,不能打开 I/O 流\n");}fwrite($stdout, "请输入项目路径");$project = fgets($stdin);$project = trim($project);fwrite($stdout, "请输入加密后项目路径: ");$new_project = fgets($stdin);$new_project = trim($new_project);$start = time();fwrite($stdout, "加密ing...\n");encrypt_project($project, $new_project);$spend = time() - $start;fwrite($stdout, "完成加密, 用时 {$spend} 秒.\n");?>
2023年08月08日
10 阅读
0 评论
0 点赞