Module::CryptSource - Encrypt and Decrypt source for Binary Packagers
In myprog.pl:
use Module::CryptSource;
Afterwards:
% perl myprog.pl --ensrc % perlapp -f myprog.pl # or perl2exe % myprog.exe --desrc
One of the problems in binary packages such as perlapp or perl2exe is the difficulty of uncovering the source code. While it can be argued that obscuring source code may be necessary in some environments, it could be disastrous when you accidentally lose the source code.
This self-modifying module let you specify a key to encrypted source code and modules, so you can use that key to retrieve them back.
To use this module, simply put use Module::CryptSource; in all scripts and modules you wish to encrypt. Run it once with the --ensrc option before running perlapp or perl2exe, so it can store the modified Module/CryptSource.pm along with your .exe file; copies of encrypted source files will be stored in the Module/CryptSource.pm file.
--ensrc
Run the resulting executable with --desrc to decrypt the source files back.
--desrc
Storable, Crypt::Rijndael and Term::ReadKey are three XS modules you'll have to install it yourself. It's probably possible to use Crypt::Rijndael_PP and Win32::* as alternatives, but I don't have the motivation to investigate yet.
Win32::*
If user enters a wrong decryption key, chances are that the unpack('N/a*') will report an Out of memory! error.
unpack('N/a*')
Out of memory!
Autrijus Tang <autrijus@autrijus.org>
Copyright 2001, 2002 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Module::CryptSource, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::CryptSource
CPAN shell
perl -MCPAN -e shell install Module::CryptSource
For more information on module installation, please visit the detailed CPAN module installation guide.