|
NAMEFilter::CBC - Source filter for Cipher Block ChainingSYNOPSIS# Please don't encrypt me! use Filter::CBC "Rijndael","my secret key"; # This file will be encrypted and overwritten. # Make backups, damnit! # Autofilter example print "Don't try this at home, kids !"; -or- # Please don't encrypt me! use Filter::CBC "",""; # This file will be encrypted and overwritten. # Make backups, damnit! # Autofilter example # Defaults will be used # Rijndael is default encryption algorithm # Default keyphrase is : This space is left blank intentionally print "Don't try this at home, kids !"; -or- BEGIN { use LWP::Simple; my $key = get("http://www.somesite.com/key.txt"); } use Filter::CBC "Rijndael",$key; secretstuff(); DESCRIPTIONFilter::CBC is a Source filter that uses Cipher Block Chaining (CBC) to encrypt your code. The tricky part is that most CBC Algorithms have binary output. The textmode bypasses this obstacle, by converting the data to less scary data.DOWNSIDES
PARAMETERSThe two parameters that can be passed along are :
INTERNAL CBC HANDLERSThe following parameters can be passed as part of the CBC encryption routine
But any CBC Compatible routine will work. TEXT HANDLERSAs Paul Marquess noted, Filter has no problems with binary data. The text handlers are totally unnecesary. I therefor removed them. You can still use hex encoding by using the Filter::Hex module provided in the obsolete directory. If you have code that used the older version of Filter::CBC, I recommend stacking the HEX filter. Edit the use statement as follows :use Filter::Hex; use Filter::CBC "Rijndael","my secret key"; AUTOFILTERINGSince Filter::CBC 0.04, using code2cbc isn't required anymore. Filter::CBC can encrypt your code on the fly if it's not yet encrypted. Be warned that your source file is overwritten. You can use cbc2code.pl to decrypt your encrypted code. BACKUP!use Filter::CBC "Rijndael","my secret key"; # This file will be encrypted and overwritten. # Make backups, damnit! # Autofilter example print "Don't try this at home, kids !"; This code will be encrypted the first time you run it. Everything before the 'use Filter::CBC' line is kept intact. Filter::CBC sets a 'marker' so that double encryption doesn't occur. If you see a comment stating 'This space is left blank intentionally', ignore it. DEFAULTS
This space is left blank intentionally REQUIREMENTSFilter::CBC requires the following modules (depending on your needs)
THANKS A MILLIONAlot of thanks to Ray Brinzer (Petruchio on Perlmonks) for giving an example on how to handle parameters with use.Paul Marquess for writing Filter and pointing out that Filter does what it should and not what I expect it to. A bunch of monks at Perlmonks for giving some excellent and well appreciated feedback on detecting code. Thank you Blakem, Petral, Chipmunk, Tilly, Jepri and Zaxo. TODOA bit less then first release but still plenty.DISCLAIMERThis code is released under GPL (GNU Public License). More information can be found on http://www.gnu.org/copyleft/gpl.htmlVERSIONThis is Filter::CBC 0.09AUTHORHendrik Van Belleghem (beatnik -at- quickndirty -dot- org)SEE ALSOGNU & GPL - http://www.gnu.org/copyleft/gpl.htmlFilter::Util::Call - http://search.cpan.org/search?dist=Filter Crypt::CBC - http://search.cpan.org/search?dist=Crypt-CBC Crypt::Rijndael - http://search.cpan.org/search?dist=Crypt-Rijndael Crypt::DES - http://search.cpan.org/search?dist=Crypt-DES Crypt::IDEA - http://search.cpan.org/search?dist=Crypt-IDEA Crypt::Blowfish - http://search.cpan.org/search?dist=Crypt-Blowfish Crypt::GOST - http://search.cpan.org/search?dist=Crypt-GOST Crypt::DES_EDE3 - http://search.cpan.org/search?dist=Crypt-DES_EDE3 Crypt::Twofish - http://search.cpan.org/search?dist=Crypt-Twofish Crypt::NULL - http://search.cpan.org/search?dist=Crypt-NULL Crypt::TEA - http://search.cpan.org/search?dist=Crypt-TEA Crypt::RC6 - http://search.cpan.org/search?dist=Crypt-RC6 Crypt::Serpent - http://search.cpan.org/search?dist=Crypt-Serpent Paul Marquess' article on Source Filters - http://www.samag.com/documents/s=1287/sam03030004/
Visit the GSP FreeBSD Man Page Interface. |