我有一个需要编码的testcode.php文件:
<?php
$hello = "Hello World!";
?>我创建了encode.php文件来加密和测试该文件:
<?php
/* read the PHP source code */
$source_code = file_get_contents("testcode.php");
/* create the encrypted version */
$redistributable_key = blenc_encrypt($source_code, "encrypt.php");
/* read which is the key_file */
$key_file = ini_get('blenc.key_file');
/* save the redistributable key */
file_put_contents($key_file, $redistributable_key, FILE_APPEND);
include 'encrypt.php';
echo $hello;
?>但是,在运行encode.php时,我重述了这些错误:
警告: blenc_compile:脚本'encrypt.php‘的验证失败。MD5_FILE: 910e6a45f806ba3dc42830839971cb53 MD5_CALC: c38a6b2f389267a272ea656073a463ed in C:\xampp\htdocs\PHPEncode\encode.php,第14行
和
致命错误: blenc_compile:对脚本'encrypt.php‘的验证失败,无法执行。在第14行的C:\xampp\htdocs\PHPEncode\encode.php中
帮我修一下,谢谢!)
发布于 2014-11-24 11:16:43
当blenc.key_file中有多个可再分发密钥时,BLENC会出现问题。请看我报告的PHP #68490。
而且,当您多次运行脚本时,可重新分发的密钥将在blenc.key_file中损坏。这是因为您要附加到文件中,但是所有的键都保存在同一行中(同一已损坏的示例在php手动页面上)。你应该把它改为:
file_put_contents($key_file, $redistributable_key."\n", FILE_APPEND);第二个致命错误可能是由于损坏的blenc.key_file造成的。
发布于 2014-12-16 10:44:27
)只需删除页面中的"<?php ?>“,*.php就会编译它,而不是用"<?php and ?>”
$hello =“你好世界!”;
而且很好:)!
发布于 2014-09-11 12:00:35
您需要在名为blenc.key_file或通过.htaccess的php.ini变量中指定ini_set()的完整位置,不可能在运行时使用ini_set()设置(此时密钥文件已经读取)。
.htaccess示例:
php_value blenc.key_file /path/path/path/key_file.blenc每次加密文件时,都会生成一个新的$redistributable_key!您必须将所有密钥包含在密钥@中,或者在所有加密中使用固定(私有)加密密钥:
$private_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVCHANGEME";
$redistributable_key = blenc_encrypt($source_code, "encrypt.php", $private_key);https://stackoverflow.com/questions/24159194
复制相似问题