Re: peeking at the working interpreter
by t0mas (Priest) on Sep 06, 2000 at 11:32 UTC
|
I've used the simple rot13 perl filter from the pod (for amusement). If you start the debugger (perl -d <rot13_encrypted_file>) and do a
l 1-10 (list rows 1-10) you'll get them fully readable and decrypted. I haven't tried any C language perl filters, but you can try to have a peek your self with perl -d.
You'll probably need to statically link the decrypter in perl and also disable debugging to have some small ammount of security.
/brother t0mas
| [reply] |
|
|
The -d option is disabled when you use the decrypt template from the Filter module at CPAN. At least this seems to be safe from the perl debugger. This is is the code that does the disabling on the decrypt.xs file:
#ifdef DEBUGGING
/* Don't run if compiled with DEBUGGING */
croak("recompile without -DDEBUGGING") ;
#endif
. . .
/* make sure the Perl debugger isn't enabled */
if( PL_perldb )
croak("debugger disabled") ;
| [reply] [d/l] |
|
|
The -d option is disabled when you use the decrypt template from the Filter module at CPAN
Good move.
Try hitting it with perl -MO=Deparse file.pl and see what you get. Deparse uses the internal compiled structure, maybe you'll get lucky? with that. I don't know if you'll be able to run the B:: modules without the debugger (I've never compiled perl without it) so I'm just guessing here :)
/brother t0mas
| [reply] |
|
|
|
|
|
Re: peeking at the working interpreter
by ncw (Friar) on Sep 06, 2000 at 20:21 UTC
|
This situation is exactly equivalent to DeCSS - it isn't real
encryption only obfuscation since you provide the keys
to the decryptor in the program (albeit in compiled C).
If it was my job to hack this then I'd core dump the process
and use the debugger on that. Either that or become root
save the process memory etc.
Any way you choose it will be hackable - this kind of
copy protection does not work!
| [reply] |
|
|
| [reply] |
|
|
Certainly I lock my car in the car park - but I then take
key with me ;-)
With this sort of software 'protection' you are leaving
the key in the software - rather like leaving the key of
your car in the exhaust/tail pipe. It is security by
obscurity.
Apologies for the rant, but this is one of the areas that
I feel strongly about - it isn't possible to copy protect
digital media like this, be it DVD discs, audio, books or
programs (to name 4 media with high profile cracks).
If you supply the key with the media (or with the software
that decodes the media) you haven't added any security
only obscurity. To have real security you need to pass the
key seperately, eg on a dongle, smart card, my PGP key
exchange etc, and you need to individually encrypt each
item.
| [reply] |
|
|
|
|
|
|
| [reply] |
Re: peeking at the working interpreter
by elwarren (Priest) on Sep 07, 2000 at 22:35 UTC
|
What version and platform are you using perl with? There were several perl2c and perl2exe projects floating around the net for awhile.
I believe perl used to have a command line switch that would dump the compiled perl byte code which could then be run. I never used it, so I'm not sure if it works, I just remember reading it somewhere...
Ah yes, here it is in the perlrun page:
-u
causes Perl to dump core after compiling your script. You can then in theory take this core dump and turn it into an executable file by using the
undump program (not supplied). This speeds startup at the expense of some disk space (which you can minimize by stripping the executable).
(Still, a ``hello world'' executable comes out to about 200K on my machine.) If you want to execute a portion of your script before dumping, use
the dump() operator instead. Note: availability of undump is platform specific and may not be available for a specific port of Perl. It has been
superseded by the new perl-to-C compiler, which is more portable, even though it's still only considered beta.
This was from a 5.005 install, HTH
| [reply] |