[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Extensions



At 4:56 PM -0800 2/20/98, Vicki Brown wrote:
>Tell me more, please?
>
>I've been told that we want to be able to "obfuscate" or "encrypt" some of
>our Perl source before we send it to customers (deja vu) and this sounds
>promising. Is it part of a bigger Module (package?).  Is it on the CPAN?
>What more can you tell me? A small example or two would help a million.

Sure.  It *is* on CPAN.  The module is named Filter.  It has components
that allow you to massage the subsequent perl source code in various ways.
There is scaffolding to allow the massaging to be done from either C code
or from perl code, and it can be nested.

An example (from memory, so it may be wrong in detail):

use Filter(uuencode);
begin
Mxkljdlkjagkjharg
Mlkjvake
M (but with real uuencoded data instead of hand-typed gibberish)
end

The uuencoded stuff, after decoding might use another filter to decrypt
binary data.  The output of *that* might use a decompression filter.

As well as the generic drivers for perl/C filters, there are some specific
filters provided.  One is a decryption filter - it uses a trivial form of
encryption (it shows you what the interface looks like, you fill in your
own encryption routine that meets your own security needs).  Another provides
the same function as the -P command line option that runs cpp (the C pre-processor)
over the perl code before it gets seen by perl.

To use this properly for encrypted scripts, you really should build your own
copy of perl, compiling the Filter module and your decrpytion module statically
into the same program.  Filter works fine as a dynamically loaded external
module (I don't know how that fits with MacPerl, this is my experience on Unix
I'm talking about) - but if you have a dynamically loadable decryption module
then somebody could build their own program that uses that module to decrypt
your scripts into their own program instead of into MacPerl.

>Thanks -
>
>Vicki

My pleasure.


John Macdonald             jmacd@interlog.com