The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Filter::Crypto::Decrypt - Perl source code filter to run encrypted Perl files

SYNOPSIS

    use Filter::Crypto::Decrypt;

DESCRIPTION

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.

DIAGNOSTICS

Warnings and Error Messages

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).
Can't add MAGIC to decryption filter's SV

(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.

Can't complete decryption: %s

(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.

Can't continue decryption: %s

(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.

Can't find MAGIC in decryption filter's SV

(F) The MAGIC assigned to the SV used by the source code decryption filter to maintain state could not be found.

Can't run with DEBUGGING flags

(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.

Can't run with DEBUGGING perl

(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.

Can't run with extra filters

(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.

Can't run with Perl compiler backend

(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.

Can't run with Perl debugger

(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.

Can't start decryption: %s

(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.

Found wrong MAGIC in decryption filter's SV: No valid mg_ptr

(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.

Found wrong MAGIC in decryption filter's SV: Wrong mg_ptr "signature"

(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.

No such package '%s'

(F) This module's bootstrap function was called on the specified package, which does not exist.

Unknown crypto context mode '%d'

(I) The crypto context structure used internally when performing decryption has been set-up with a crypt mode that it does not recognize.

EXPORTS

None.

KNOWN BUGS

__DATA__ is not accessible when running encrypted files.

See https://rt.cpan.org/Ticket/Display.html?id=54370.

Infinite loop when running a program using an encrypted Data::Alias.

See https://rt.cpan.org/Ticket/Display.html?id=122951.

SEE ALSO

Filter::Crypto;

Filter::CBC, Crypt::License.

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.)

ACKNOWLEDGEMENTS

Much of the XS code is based on that in the Filter::decrypt module (version 1.49), written by Paul Marquess.

Thanks to Nick Ing-Simmons for help in getting the MAGIC attached to the decryption filter's SV working.

AUTHOR

Steve Hay <shay@cpan.org>.

COPYRIGHT

Copyright (C) 2004-2009, 2012-2014 Steve Hay. All rights reserved.

LICENCE

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

Version 2.10

DATE

02 Jul 2023

HISTORY

See the Changes file.