http://www.perlmonks.org?node_id=299052


in reply to simple encryption for perl files

See the Obfuscation section for details on rendering functional programs illegible. You get bonus points for doing it by hand, without the aid of unPerlish mechanisms.

If that's not quite what you had in mind, check out the Q&A section: How do I compile my script so that it becomes a standalone executable?, or perlfaq3: "How can I hide the source for my Perl program?" Or see the responses to Protecting Perl Code and Source Hiding. Then wake up and remember this is Perl.

If you plan to figure out a scheme for hiding your source, be sure that any use of CPAN modules in your program meets the requirements of the modules' licenses. Though the modules are available to all who comply with the licensing, remember that they wouldn't be available to you if their authors had ventured down the "hide the code" road. Even Perl's source code is readily available to the world, so long as the license is respected. I am pleased that Larry and gang didn't take the Gates approach to language design. ;)

Update: Re-edited final paragraph to better capture the spirit of tilly's followup message's suggestions.


Dave


"If I had my life to do over again, I'd be a plumber." -- Albert Einstein

Replies are listed 'Best First'.
Re: Re: simple encryption for perl files
by tilly (Archbishop) on Oct 14, 2003 at 12:55 UTC
    Please don't tell people to not use any CPAN modules in a plan like this. The authors of CPAN modules each get to choose their own license, and people choose to contribute open source code under different terms for different motivations. Even if you are outraged at a given possible use, you don't get to retrofit your opinion onto other peoples' code. It is their work.

    Instead tell them that they must (both morally and legally) respect the CPAN authors' right to choose their own license, and be sure that if any CPAN code is included, that it is included in a way that meets the license on that code.

    For instance Larry Wall clearly doesn't mind if people embed Perl into proprietary programs. The Artistic License, which he wrote, goes out of its way to make it extremely explicit that this is OK so long as you aren't trying in any way, shape, or form to create any confusion about what Perl is. This is not an accidental oversight on his part, and you have no right to be outraged at people taking him up on his offer.

    While I haven't had the pleasure of meeting Larry Wall, I would summarize my impression of his opinion as, The best way to help others to learn to be nice is to be nice to them first, and besides, it's nice to be helpful.

    Incidentally this point underscores why the open source and free software movements really are different. The free software folks (Stallman, etc) believe that non-free software is an injustice. Therefore it is never OK. By contrast open source arguments say that it makes sense for lots of reasons to make software free, but don't close the door to saying that it is OK to make other software proprietary, and don't phrase anything in moralistic terms. Attempting to project the values of one onto the proponents of the other will almost always mislead you about what that person is saying or cares about.