-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腳本源,此時我懷疑任何保護措施都有幫助。 –