-2
在php中有很多代码保护库,但是他们需要安装额外的php模块,这是我无法承受的,因为应用程序将在我没有的服务器上运行。所以我想我可以自己做。PHP代码保护库
我想要做什么:
$source = file_get_contents("encryptedPhpFile.php");
$source = decrypt($source, "mySecretKey");
//$source now contains decrypted source code which needs to be included
//I cant use eval($source); because that code also contains
//html/css/opening and closing php tags ... which eval() does
//not know how to render
//I cant write the source into temporary file and then include
//that file because as soon as I write decrypted source to a disk,
//it is exposed and it can be copyed
我能做些什么?有什么建议么?
没什么可靠的。您唯一的选择是评估或编写一个包含源文件的文件。但是,这不以任何方式“安全”。在'decrypt'调用之后,所有人都必须做'echo $ source',并且他们有你的全部源码。 –
标题并不能真正恰当地描述问题。你能改善它吗? –
为什么你需要“保护”你的代码呢?除非整个服务器受到攻击,否则人们无法下载您的php脚本源,此时我怀疑任何保护措施都有帮助。 –