免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 8043 | 回复: 18
打印 上一主题 下一主题

如何保护perl源代码--防止别人修改? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-05 22:34 |只看该作者 |倒序浏览
最近要解决这样的问题,一般像这种脚本性解释语言,不能像其他高级语言那样编译成二进制代码,所以它们的openSource几乎不可避免,不知道各位有什么好的方法,可以将一个很大的工程项目(较多的.pl 和 .pm文件)保护起来?

我在网上找到perl2exe这个工具,它对于单个perl脚本或者较少file的项目比较有用,可应用在我们的项目上,会有程序执行中的错误,俺头大了!

期待各位的回复与指导。

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
2 [报告]
发表于 2006-01-09 10:58 |只看该作者
其实我也在找这样的东西...只是要for unix的...
可以把整个directory与相关perl modules包起来....然後执行时,自动compile...
source code不要给别人看...
不过找不到..所以目前我在做程序java化的工作...
改用java OO写,比起perl..真累人呀...

PAR看起来只能是用在单一file...但是我有一堆files...

论坛徽章:
0
3 [报告]
发表于 2006-01-09 12:18 |只看该作者
关注呀

论坛徽章:
0
4 [报告]
发表于 2006-01-09 14:19 |只看该作者
结果肯定是要让你们失望了,如果Par无法满足你们的要求,activeperl perl devkit同样会让你们失望,毕竟这个还需要购买。
如果你们决定用脚本语言编程,那么就不要想着将自己的代码藏起来,起码在perl6出现前不会有好的解决方案。
其实,更关键的在于是否有必要将自己的代码隐藏?毕竟你们所使用的是opensouce的开发工具,你们不遵从opensource的原则真的那么重要?
害怕被别人偷看?

论坛徽章:
0
5 [报告]
发表于 2006-01-09 15:10 |只看该作者
From: PerlFAQ Server <comdog@pair.com>
Subject: FAQ 3.20 How can I hide the source for my Perl program?
Newsgroups: comp.lang.perl.misc
Date: Mon, 9 Jan 2006 05:03:01 +0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC

This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

3.20: How can I hide the source for my Perl program?

    Delete it. Seriously, there are a number of (mostly unsatisfactory)
    solutions with varying levels of "security".

    First of all, however, you *can't* take away read permission, because
    the source code has to be readable in order to be compiled and
    interpreted. (That doesn't mean that a CGI script's source is readable
    by people on the web, though--only by people with access to the
    filesystem.) So you have to leave the permissions at the socially
    friendly 0755 level.

    Some people regard this as a security problem. If your program does
    insecure things and relies on people not knowing how to exploit those
    insecurities, it is not secure. It is often possible for someone to
    determine the insecure things and exploit them without viewing the
    source. Security through obscurity, the name for hiding your bugs
    instead of fixing them, is little security indeed.

    You can try using encryption via source filters (Starting from Perl 5.8
    the Filter::Simple and Filter::Util::Call modules are included in the
    standard distribution), but any decent programmer will be able to
    decrypt it. You can try using the byte code compiler and interpreter
    described below, but the curious might still be able to de-compile it.
    You can try using the native-code compiler described below, but crackers
    might be able to disassemble it. These pose varying degrees of
    difficulty to people wanting to get at your code, but none can
    definitively conceal it (true of every language, not just Perl).

    It is very easy to recover the source of Perl programs. You simply feed
    the program to the perl interpreter and use the modules in the B::
    hierarchy. The B:eparse module should be able to defeat most attempts
    to hide source. Again, this is not unique to Perl.

    If you're concerned about people profiting from your code, then the
    bottom line is that nothing but a restrictive license will give you
    legal security. License your software and pepper it with threatening
    statements like "This is unpublished proprietary software of XYZ Corp.
    Your access to it does not give you permission to use it blah blah
    blah." We are not lawyers, of course, so you should see a lawyer if you
    want to be sure your license's wording will stand up in court.

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
6 [报告]
发表于 2006-01-09 16:32 |只看该作者
所以我要改写成java..其实我也不愿意改写成java..
只是老板要我改...我也不敢说不改....

不过改java 也有好处...至少维护比较方便..因为懂java的人比懂perl的人多很多...

论坛徽章:
0
7 [报告]
发表于 2006-01-10 16:49 |只看该作者

在unix下,是否可以用perlcc将perl编译成C,然后在编译成可执行文件??有人用过吗?

期待中!!

论坛徽章:
0
8 [报告]
发表于 2006-01-23 10:51 |只看该作者
原帖由 alexe 于 2006-1-9 14:19 发表
结果肯定是要让你们失望了,如果Par无法满足你们的要求,activeperl perl devkit同样会让你们失望,毕竟这个还需要购买。
如果你们决定用脚本语言编程,那么就不要想着将自己的代码藏起来,起码在perl6出现前不会 ...



给人写个小工具,总不能让人家安装perl吧。然后让他自己ppm模块去?现在最大的问题是小工具多了,每个编译出来都是2-4M,真是晕死

论坛徽章:
0
9 [报告]
发表于 2006-01-23 11:41 |只看该作者
原帖由 fandatou 于 2006-1-23 10:51 发表



给人写个小工具,总不能让人家安装perl吧。然后让他自己ppm模块去?现在最大的问题是小工具多了,每个编译出来都是2-4M,真是晕死


应该说是,安装一个简化版的perl,然后你只要将你的代码发布就可以了。
每个工具只有不超过100K,很方便。

论坛徽章:
0
10 [报告]
发表于 2006-01-23 13:42 |只看该作者
  我现在是随身携带一个U盘,里面装一个 vim 的安装包和一个 ActivePerl 的安装包。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP