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

Re: [MacPerl] cryptswitch()



eric m. mosher wrote :
|| can anyone sheed any light on
|| 
|| cryptswitch()?
|| 
|| we wand to "hide" some scripts that are going
|| to be distributed, for profit.

Sure.  First of all, cryptlocal only pertains to perl 4;
things have changed significantly in perl 5.

In the perl source directory, take a look in the file
usersub.c.  It has some code that is conditionally compiled in
if CRYPTSWITCH has been defined.  Within that code there are
some parts that are always used, and a section that is only
compiled in if the CRYPTLOCAL symbol is *not* defined.  That
code is a template for writing your own decryption routine.
Write a subroutine with the same interface, but which provides
for a stronger encryption algorithm and place it in the file
cryptlocal.h.

Then, when you compile perl make sure that you have
-DCRYPTSWITCH -DCRYPTLOCAL defined in your cc options.

When you are ready to ship your scripts, then you'll have to
encrypt them - using a program that is compatible with the
algorithm used in your decryption subroutine that you embedded
into perl above.

In perl 5, you'll be able to simply build perl using your
decryption routine as a static extension, and then use the
filter package to invoke decryption from your scripts.  But that
won't be fully ready until 5.002 is released (coming soon).

(I'm not on the MacPerl mailing list, so copy me on replies if
you want further info.)

-- 
Maybe we can fix reality one of these days.   | John Macdonald
<- Larry Wall                 Carl Dichter -> |   jmm@Elegant.COM
      I'd be happy if we could just index it. |