如何隐藏 Perl 代码?
我已经编写了一些 Perl 程序并计划分发它们。它们是大型二进制发行版的一部分(主要是编译的 C/C++)。如果可能的话,我宁愿放弃尽可能少的东西(我负责提供工作软件,而不是提供聪明的算法)。隐藏 Perl 代码的最佳选择是什么,这样如果有人真的想查看源代码,他们就必须付出比简单地在编辑器中打开文件更多的努力?
I've written some Perl programs and am planning on distributing them. They're part of a large binary distribution (mostly compiled C/C++). If possible, I'd prefer to give up as little as possible (I'm responsible for delivering working software, not delivering clever algorithms). What is my best bet for hiding the Perl code so that if someone really wants to see the source, they'd have to put a bit more effort than in than simply opening the file in an editor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以加密代码,然后在运行时解密并将其发送到
perl
stdin
。 (当然解密器不会被加密)。我得到了一些关于我的问题的缩小/编译答案 如何编译 Perl 脚本以减少启动时间?
You could encrypt your code and then at run time decrypt it and send it to
perl
stdin
. (of course the decryptor would not be encrypted).I got some minify/compile answers to my question How can I compile my Perl script so to reduce startup time?
Acme::Bleach
Acme::Bleach
Filter::Crypto(可能通过 PAR::Filter::Crypto)显然是这项工作最先进的开源工具(除了 perlcc,它在很多方面都不能很好地工作,YMMV)。
如果您只想对随意修补者隐藏代码,那就足够了。对有决心和/或有能力的人隐藏它实际上是不可能的。
Filter::Crypto (potentially via PAR::Filter::Crypto) is clearly the most advanced open source tool for this job (barring perlcc which doesn't work well for many things, YMMV).
If all you want is hide the code from casual tinkerers, that's more than sufficient. Hiding it from determined and/or capable people is practically impossible.
它不会使打开文件变得更加困难,但混淆器会使理解和修改代码变得更加困难。看看这里或这里作为开始。
It won't make it harder to just open the files but an obfuscator can make it more difficult to understand and modify your code. Have a look here or here for a start.