This question comes up regularly. The Perl community is founded on openness and the idea of locking away source code seems to bother many people. Without the generosity of many people, we would not have Perl to hack with. The usual response is "you can't do it".

In purely technical terms, that is true. If the computer has the key to decrypt and run the software, a sufficiently clever, dedicated person can recover the keys and decrypt the code. Once you have executable code you can do all sorts of things to clean it up and make it easier to reverse engineer. An absolute solution is impossible. What you need is a "good enough" solution.

I've been using PerlApp to distribute apps on Win32 systems for several years. It works well, it is inexpensive, and is produced by a company that is a good member of the community. It won't make your code impossible to recover, but it does provide easy to transport and install packages that are not trivial to recover code from.

It may be possible to do similar things with PAR-Packer and PAR::Filter::Crypto. PAR is a great tool for packaging Perl code for distribution. I've never tried to use it for code hiding, so I don't know what is possible with PAR in this area.

It is impossible to perfectly protect your code, but these two options should give you a way to come up with a "good enough" approach.


TGI says moo


In reply to Re: Seek suggestion on Encryption my Perl code by TGI
in thread Seek suggestion on Encryption my Perl code by srinivas_rocks

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.