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
Run Code Online (Sandbox Code Playgroud)
我能做什么?有什么建议?
这些库是模块的原因.您将无法在"代码空间"中完全模拟它们.你的尝试将是笨拙的(不是你的错),并使你的代码库不那么令人满意/可维护.
相反,您应该集中精力获取安装它们的权限,迁移到允许您将服务器控制到有用程度的主机,或者让您自己的服务器启动并运行.
一次又一次.我们无法保护PHP源代码.PHP并不意味着"受到保护".即使将代码编译为二进制文件也容易进行逆向工程.在你的例子中,当你decrypt使用秘密密钥(秘密 - 他在哪里)时你会做什么?评估一下吗?用echo替换eval.
写下执照并与律师合法工作.组织商业模式,以便您的客户愿意向您付款,以便获得更新和支持.
关于代码保护库(付费代码):有免费的在线服务可以自动为您解码...