perlc
Perl source code "compiler" / hider | |
What is it?Converts perl code into either C code and/or an executable.What's the point?I'm a big fan of Perl. It's a great way to develop code. If you want to release Perl code, though, you generally have to release the source. Lots of people want to release/distribute Perl scripts with the source code hidden, so how to do this without revealing the source is a FAQ. Unfortunately the generally accepted answer is that you can't, or that it doesn't really work, or you shouldn't, or it costs lots of money. And no matter what you do, someone smart enough can extract the Perl code anyways, so don't bother. These answers are mostly true, and also a big copout. Ignoring the practicality of hiding the code in most situations just because someone can get the code is like deciding to not lock your house anymore, just because locks can be picked. I can pick the lock on your house. Fortunately I won't, and it's difficult for most people to do, so I still suggest you lock your doors. Besides, if you make it hard enough to get to the code, than the person talented enough to extract it will probably be fully capable to write it themselves and won't bother. :) So there are still plenty of things we can do to hide perl source code in most cases and against most users. Unfortunately there just haven't been any good tools to accomplish this. Here's a list of tools I found that failed to solve this problem for me:
perlcTakes a single perl script, converts the block using a simple encoding with an optionally defined key. The script is decoded at runtime and fed to the perl library, to avoid it getting in the hands of the user. You can optionally run the PAR::Filter::Bleach on the code to make it even harder to extract. Bleach by itself is inadequate "obscurity" in this authors view, but it makes it harder to find and extract an already encoded script embedded in a C executable. It's a slight overhead in size and startup cost, plus another 'eval', but it's recommended if the output code still works. Normally it creates a smaller executable that uses libperl, but this has two issues:
Licensing supportSometimes we also want to limit distribution of the script. Again, the answer is usually that this won't stop a motivated and intelligent hacker. True. But that's a small portion of the population. So, short of writing a complete licensing solution, we can do simple things like check the mac address (hoping that it hasn't been programmatically changed :-) Any script converted by perlc will have access to the MACADDR (of the first NIC on the machine) available in $ENV{MACADDR}. Furthermore, you can specify a required MACADDR when you create the executable using the -mac option - this ends up in the C code instead of the perl code and is perhaps harder to modify or get around. Perhaps. Future versions may have a simple licensing file with an encoded host id and expiration date, let me know if that idea inspires youBUGS/CAVEATS
Requires:
Kludges:License:This software is essentially free, but please read my payment spielPlease read the full license Download:It's a single perl script.I suppose I could also supply an executable... :) InstallIt's just a perl script. No install required.Freshmeat?You bet. |