php 如何免费加密PHP文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6809679/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to encrypt a PHP file for free?
提问by Joey Morani
I have created a plugin for WordPress although I would like to encrypt it to stop people viewing the source code. I've heard of Zend Guard and IonCube although is there a free alternative to these? Thanks for the help. :)
我已经为 WordPress 创建了一个插件,尽管我想对其进行加密以阻止人们查看源代码。我听说过 Zend Guard 和 IonCube 虽然有免费的替代品吗?谢谢您的帮助。:)
采纳答案by takeshin
Looks like the things you choose are not working this way:
看起来你选择的东西不是这样工作的:
- Wordpress is open source
- PHP is not compiled
- any obfuscation can be decoded
- Wordpress 是开源的
- PHP 未编译
- 任何混淆都可以解码
If you don't want to share the source, provide the code as a service. You may require the user to enter API key etc.
如果您不想共享源代码,请将代码作为服务提供。您可能会要求用户输入 API 密钥等。
- Execute the code on your server and send response (e.g. JSON or XML) to the Wordpress part.
- Allow only the users who paid for the service to access the service on your server
- Authenticate the users by selling and then checking the API key
- 在您的服务器上执行代码并将响应(例如 JSON 或 XML)发送到 Wordpress 部分。
- 只允许为服务付费的用户访问您服务器上的服务
- 通过销售然后检查API密钥来验证用户
See: SaaS
参见:SaaS
回答by MyXEDNotes
回答by hakre
I don't know your plugin code in specific (and obviously you don't want to make me know it), but keep in mind if you re-use parts of the wordpress codebase in your plugin, your must distribute your code under a compatible license. That means compatible to GPL v2 for the current version.
我不知道你的插件代码(显然你不想让我知道),但请记住,如果你在你的插件中重复使用 wordpress 代码库的一部分,你必须在一个兼容的许可证。这意味着与当前版本的 GPL v2 兼容。
However this GPL license requires you to provide source code, which specifically means non-obfuscated and non-encrypted. Source-code is the form of a software youuse to make modifications to it.
但是,此 GPL 许可证要求您提供源代码,这具体意味着未混淆和未加密。源代码是您用来对其进行修改的软件形式。
So in your case, encrypting your plugin's code and distributing it could result in a termination of usage rights on the wordpress code for you. This includes the right to create derivates (your plugin) and distribute such derivates (sending your plugin to someone else). Naturally those who will get that plugin do not have any license as well to make use of your derivate.
因此,在您的情况下,加密您的插件代码并分发它可能会导致终止您对 wordpress 代码的使用权。这包括创建衍生品(您的插件)和分发此类衍生品(将您的插件发送给其他人)的权利。当然,那些将获得该插件的人也没有任何许可来使用您的衍生产品。
That's not really an ideal situation if you ask me, especially as once termination of rights is in effect, you must get into contact with every single copyright holder of the wordpress package and ask for re-instatement of rights, something you will be hardly able to.
如果你问我这不是一个理想的情况,尤其是一旦权利终止生效,你必须联系 wordpress 包的每个版权所有者并要求恢复权利,这是你几乎无法做到的到。
So take care if you re-use existing code or create derivates that you meet the licensing requirements. Especially if it's about your rights.
因此,如果您重用现有代码或创建满足许可要求的衍生产品,请务必小心。尤其是如果它是关于你的权利。
IANAL and I can only suggest that next to the technical part like obfuscation/encryption there is also the part of software licensing that can play a role. You just should contact a lawyer and clarify that software licensing situation not that your customers one day demand stuff from you, you never thought about you must deal with. In the end you will have a contract with your customers, so better take care.
IANAL 和我只能建议在像混淆/加密这样的技术部分旁边还有软件许可的部分可以发挥作用。您应该联系律师并澄清软件许可情况,而不是您的客户有一天会向您索取东西,您从未想过您必须处理。最后,您将与客户签订合同,因此最好小心。
回答by fyr
What your are looking for is an obfuscator for php. This post may be a duplicate to: Is there a code obfuscator for PHP?
您正在寻找的是 php 的混淆器。这篇文章可能与以下内容重复:是否有 PHP 代码混淆器?
However some words. Contributions to the opensource world like contributing a wordpress plugin may help you more while people are able to read your code.
不过有些话。对开源世界的贡献,比如贡献一个 wordpress 插件可能会帮助你更多,同时人们能够阅读你的代码。
回答by datasage
Since PHP is not compiled. Ioncube and Zend Guard are your only options. Your users will also need to install the loaders for those addons in order to use your code. Which may not be possible in many hosting situations.
因为 PHP 没有被编译。Ioncube 和 Zend Guard 是您唯一的选择。您的用户还需要为这些插件安装加载器才能使用您的代码。在许多托管情况下这可能是不可能的。
Since those plugins are designed to encrypt complete applications, they or may not work with plugins.
由于这些插件旨在加密完整的应用程序,因此它们或可能无法与插件一起使用。