Crypt::Blowfish - Perl Blowfish encryption module
use Crypt::Blowfish;
Blowfish is capable of strong encryption and can use key sizes up to 56 bytes (a 448 bit key). You're encouraged to take advantage of the full key size to ensure the strongest encryption possible from this module.
The module implements the Crypt::CBC interface. You're encouraged to read the perldoc for Crypt::CBC if you intend to use this module for Cipher Block Chaining.
Crypt::CBC has the following methods:
Returns the size (in bytes) of the block cipher.
Returns the size (in bytes) of the key.
my $cipher = new Crypt::Blowfish $key;
This creates a new Crypt::Blowfish BlockCipher object, using $key, where $key is a key of keysize() bytes.
keysize()
my $cipher = new Crypt::Blowfish $key; my $ciphertext = $cipher->encrypt($plaintext);
This function encrypts $plaintext and returns the $ciphertext where $plaintext and $ciphertext should be of blocksize() bytes.
blocksize()
my $cipher = new Crypt::Blowfish $key; my $plaintext = $cipher->decrypt($ciphertext);
This function decrypts $ciphertext and returns the $plaintext where $plaintext and $ciphertext should be of blocksize() bytes.
my $key = pack("H16", "0123456789ABCDEF"); my $cipher = new Crypt::Blowfish $key; my $ciphertext = $cipher->encrypt("plaintex"); # NB - 8 bytes print unpack("H16", $ciphertext), "\n";
Crypt::Blowfish has been tested successfully against the following:
Linux 2.2.X (RH6.X, Mandrake 6.5) Solaris 2.7 SPARC FreeBSD 3.4 FreeBSD 3.3 HP-UX B.10.20 (using HP's cc)
Crypt::Blowfish has been tested and failed against the following:
FreeBSD 3.2 Win32
To use the CBC mode, you must use Crypt::CBC version 1.22 or higher.
Crypt::CBC, Crypt::DES, Crypt::IDEA
Bruce Schneier, Applied Cryptography, 1995, Second Edition, published by John Wiley & Sons, Inc.
The implementation of the Blowfish algorithm was developed by, and is copyright of, A.M. Kuchling. Other parts of the perl extension and module are copyright of Systemics Ltd ( http://www.systemics.com/ ). Code revisions, updates, and standalone release is the copyright of W3Works, LLC.
Original algorithm, Bruce Shneier. Original implimentation, A.M. Kuchling. Original Perl impilmentation, Systemics Ltd.
Current revision and maintainer: Dave Paris <amused@pobox.com>
To my wonderful wife for her patience & love. To EFNet #perl, to infobot #perl, to the folks that helped test this module. A special thanks to my friends for guidance and support. Perl couldn't have had this module without ya'll.
To install Crypt::Blowfish, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::Blowfish
CPAN shell
perl -MCPAN -e shell install Crypt::Blowfish
For more information on module installation, please visit the detailed CPAN module installation guide.