| Filter-Crypto documentation | Contained in the Filter-Crypto distribution. |
Filter::Crypto::Decrypt - Perl source code filter to run encrypted Perl files
use Filter::Crypto::Decrypt;
This module provides a Perl source code decryption filter for running files that have been encrypted via the Filter::Crypto::CryptFile module.
You should rarely, if ever, need to touch this module. The encrypted files
produced by the Filter::Crypto::CryptFile module
will automatically have the "use Filter::Crypto::Decrypt;" statement added to
the start of them, which is all that is required to bring this decryption filter
into play. See perlfilter if you want to know more about how Perl source
code filters work.
This module may produce the following diagnostic messages. They are classified as follows (a la perldiag):
(W) A warning (optional).
(F) A fatal error (trappable).
(I) An internal error that you should never see (trappable).
(F) The SV used by the source code decryption filter to maintain state could not be assigned MAGIC to have it automatically free up allocated memory when it is destroyed.
(F) There was an error producing the final block of decrypted data. The cipher context structure used to perform the source code decryption could not be finalized so the decryption could not be completed. The last error message from the decryption code is also given.
(F) There was an error reading or decrypting a block of data from the encrypted Perl file. The cipher context structure used to perform the source code decryption could not be updated so the decryption could not continue. The last error message from the decryption code is also given.
(F) The MAGIC assigned to the SV used by the source code decryption filter to maintain state could not be found.
(F) The encrypted Perl file is being run by a Perl with DEBUGGING flags enabled,
e.g. perl -Dp file. This is not allowed since it may assist in retrieving
the original unencrypted source code.
(F) The encrypted Perl file is being run by a Perl that was built with DEBUGGING
enabled, i.e. -DDEBUGGING. This is not allowed since it may assist in
retrieving the original unencrypted source code.
(F) The encrypted Perl file is being run through extra source code filters (i.e. over and above the decryption filter provided by this module). This is not allowed since it may assist in retrieving the original unencrypted source code.
(F) The encrypted Perl file is being run by a Perl with the Perl compiler
backend enabled, e.g. perl -MO=Deparse file. This is not allowed since it
may assist in retrieving the original unencrypted source code.
(F) The encrypted Perl file is being run by a Perl with the Perl debugger
enabled, e.g. perl -d:ptkdb file. This is not allowed since it may assist
in retrieving the original unencrypted source code.
(F) The cipher context structure used to perform the source code decryption could not be initialized so the decryption could not be started. The last error message from the decryption code is also given.
(F) The MAGIC found in the SV used by the source code decryption filter to
maintain state was not the correct MAGIC since it did not contain a valid
mg_ptr member.
(F) The MAGIC found in the SV used by the source code decryption filter to
maintain state was not the correct MAGIC since it did not contain the correct
"signature" in its mg_ptr member.
(F) This module's bootstrap function was called on the specified package, which does not exist.
(I) The crypto context structure used internally when performing decryption has been set-up with a crypt mode that it does not recognize.
None.
None.
The latter two modules (in separate CPAN distributions, not related to the Filter-Crypto distribution in any way) are both Perl-level source code filters and are thus even less secure than this module is. (This module's filter code is written in XS and C.)
Much of the XS code is based on that in the Filter::decrypt module (version 1.04), written by Paul Marquess.
Thanks to Nick Ing-Simmons for help in getting the MAGIC attached to the decryption filter's SV working.
Steve Hay <shay@cpan.org>
Copyright (C) 2004-2009 Steve Hay. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e. under the terms of either the GNU General Public License or the Artistic License, as specified in the LICENCE file.
Version 1.15
22 Oct 2009
See the Changes file.
| Filter-Crypto documentation | Contained in the Filter-Crypto distribution. |
#=============================================================================== # # Decrypt/lib/Filter/Crypto/Decrypt.pm # # DESCRIPTION # Module providing a Perl source code filter for running Perl files that have # been encrypted via Filter::Crypto::CryptFile. # # COPYRIGHT # Copyright (C) 2004-2009 Steve Hay. All rights reserved. # # LICENCE # You may distribute under the terms of either the GNU General Public License # or the Artistic License, as specified in the LICENCE file. # #=============================================================================== package Filter::Crypto::Decrypt; use 5.006000; use strict; use warnings; use XSLoader qw(); #=============================================================================== # MODULE INITIALIZATION #=============================================================================== our($VERSION); BEGIN { $VERSION = '1.15'; XSLoader::load(__PACKAGE__, $VERSION); } # Last error message. our $ErrStr = ''; 1; __END__ #=============================================================================== # DOCUMENTATION #===============================================================================
#===============================================================================