php代码加密|PHP源码加密——实现方法

时间:2023-03-08 23:02:30
php代码加密|PHP源码加密——实现方法

Encipher - PHP代码加密 | PHP源码加密
下载地址:https://github.com/uniqid/encipher

该加密程序是用PHP代码写的,加密后代码无需任何附加扩展,无需安装任何第三方组件,可运行于任何普通 PHP 环境下。

加密方法如下:

<?php
$app = str_replace('\\', '/', dirname(__FILE__));
require_once($app . '/lib/encipher.min.php'); $original = $app . '/original'; //待加密的文件目录
$encoded = $app . '/encoded'; //加密后的文件目录
$encipher = new Encipher($original, $encoded); /**
* 设置加密模式 false = 低级模式; true = 高级模式
* 低级模式不使用eval函数
* 高级模式使用了eval函数
*/
$encipher->advancedEncryption = true; //设置注释内容
$encipher->comments = array(
'Encipher - the PHP code encode tool',
'Version: 1.1.1',
'',
'The latest version of Encipher can be obtained from:',
'https://github.com/uniqid/encipher'
); echo "<pre>\n";
$encipher->encode();
echo "</pre>\n";