$CBAS has asked for the wisdom of the Perl Monks concerning the following question:
Because of Perl's scipt-ness, it can be hard to keep your code safe (even with strong legal mumbo-jumbo) so I was wondering what tools are available to convert a Perl script to a less open-source kinda of thing, if any.
Maybe there's a way to store the Perl bytecode and re-run it later (bytecode is a whole lot harder to read than Perl -- even obfuscated! ;-))?
Do you use such tools? Please tell me what your experience has been with them.
Thanks,
CBAS
Re: seeking the root of all evil (or the sum?)
by tadman (Prior) on Feb 16, 2001 at 23:51 UTC
|
The FAQ
seems to make a brief case, and then retire, perhaps because
this question is difficult to answer with confidence.
If you're willing to handle
a little uncertainty, and to do a bit more testing with the "secret" version of your
program to make sure things are working according to spec,
you could use perlcc, the Perl-C compiler.
While not 100% complete, seems to work on most of the stuff
that I've thrown at it. It also seems to be the most practical,
as the Perl-JVM compiler, and Perl6 and such are not done yet.
Remember, though, that compiled scripts must be re-compiled
for each and every platform that they are to be run on.
If you're considering commercial sales of this program, that
list can be pretty darned long: Linux (libc6, glibc2, RedHat 7),
BSD, Solaris(Sparc,Intel), Windows, etc. You will have to
recompile, and test, on each of these.
The "old fashioned" way of achieving
same (i.e. "binary code" version of Perl script) was to
force Perl to dump() a 'core' and convert the 'core' into an
executable using GNU unexec. See the dump()
link for more info. Of course, as that page says, this
may not actually work (at all).
A while back I came across a company that had ported their
"source protector" to work on Perl. What it basically did
was mangle variables, function names, and the like, into
line-noise-type random characters to try and obfuscate the
code automatically. It was still code, though, so it wouldn't
prevent anyone really determined to read it from doing so.
I other words, it prevented casual reading, but wasn't
an obstacle to serious efforts. | [reply] [d/l] |
Re (tilly) 1: seeking the root of all evil (or the sum?)
by tilly (Archbishop) on Feb 17, 2001 at 00:49 UTC
|
| [reply] |
Re: seeking the root of all evil (or the sum?)
by merlyn (Sage) on Feb 16, 2001 at 22:50 UTC
|
| [reply] |
|
Woops!
I had no intention to flame or insult anyone/everyone, I'm just a capitalist pig looking for ways to rip people off by charging lots of money for code that should be free anyway (hehe, just kidding ;-) )
Thanks for letting me know it was in the FAQ (asking a question on PM is generally faster than reading through thousands of bytes of FAQ texts)
But wouldn't it be a great way for Perl to gain acceptance in the (99% closed source) Windows world? (I'm thinking that's why Java, C and whatever other languages are so popular: they're free, easy, powerful and commercially exploitable)
my two eurocents,
CBAS
| [reply] |
|
Faster how?
Compare, say, 30 minutes of your time to 30 seconds of 500
people's time each. Which is faster?
Besides which, why should Perl care about gaining
acceptance among people who don't understand why it is
being given away in the first place? A lot of the people
who are giving away Perl don't mind if people producing
closed software find their stuff useful, but see no reason
to be helpful to that. Quite the contrary, if you want to
distribute obfuscated source then that is your problem and
you can do something about it if you care.
Now before you think that this is arrogant, rude, etc just
remember that this is donated effort. If you feel inclined
to help Perl be other than it is, you are free to do as
they do and donate a working solution. (In case you
didn't notice, I already gave you at least one hint
for how you might do that in another post. No you wouldn't
want to use that module, but the fact that it is possible
might give you cause to reflect.) Unless you are willing
to do that, then you don't really have much to complain
about in my books...
| [reply] |
|
No - I think that is terrible idea. If you want to hide
your code from others, then please stick to Java, C, or
Visual Basic.
Please leave my $Perl alone. It is perfectly fine, threads
would be nice, but nobody is perfect. I would
hate to see it turned into some user-friendly corporate
exploitable language.
One word: LAWYERS (/me shudders)
Jeff
R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
| [reply] |
Re: seeking the root of all evil (or the sum?)
by arturo (Vicar) on Feb 16, 2001 at 23:01 UTC
|
Religious issues aside, here's the aforementioned FAQ.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
| [reply] |
Re: seeking the root of all evil (or the sum?)
by BooK (Curate) on Feb 17, 2001 at 01:41 UTC
|
I don't know, but I'd say that B::Deparse works on bytecode.
Then only real obfuscation can save your source,
because B::Deparse will produce readable code. Perhaps
even more readable than your own...
| [reply] |
|
As just came up, it is not that hard to make
B::Deparse go sit in the corner pouting. Even without
possessing your amazing skills of obfuscation.
| [reply] |
Perl 6may allow that...
by rrwo (Friar) on Feb 17, 2001 at 23:12 UTC
|
An aside: see Perl 6 is Alive and Well.
There's some discussion about being able to distribute a bytecode file or even
packaging scripts in a kind of .jar file the way Java does that.
| [reply] |
|
|