You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2000/09/27 20:18:14 UTC

Re: Filter::decrypt under Apache::Registry.

On Thu, 10 Aug 2000, Leonardo Madrigal wrote:

> Hi everyone!
> 
> I have a bunch of scripts that i need to protect (source code), i do 
> know that Filter::decrypt is not the best tool around for this 
> matter...but still i want to use it.
> 
> I have those scripts running under Apache::Registry, they worked fine 
> till i encrypt them with Filter::, but now every time that someone 
> tries to execute a script seems like mod_perl is not trying 
> Filter::decrypt cause i get this on the logs
> 
> [Thu Aug 10 17:42:34 2000] [error] Unrecognized character \377 at 
> /usr/local/apache/spfs/index.cgi line 2.
> 
> Does anybody knows how to fix this???

the problem is that Perl's eval "" function does not support filters and
Apache::Registry uses eval "" to compile scripts.

one solution would be to wrap your crypted code in a module, consisting of
only subroutines and the main body of the code moved into a routine named 
main().  then have a registry script to run it:

use MyModule::EncryptedWithFilterCrypt ();

MyModule::EncryptedWithFilterCrypt::main();

or, have your registry script pull in the encrypted script with do:

do 'encrypted-script.pl';

but you loose some perfomance because the script is decrypted and compiled
for every request.

another solution is to not use Apache::Registry at all and move your
script into a handler.