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

NAME

Crypt::Blowfish - Perl Blowfish encryption module

SYNOPSIS

    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.

DESCRIPTION

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:

blocksize =item keysize =item encrypt =item decrypt

FUNCTIONS

blocksize

Returns the size (in bytes) of the block cipher.

keysize

Returns the size (in bytes) of the key.

new
        my $cipher = new Crypt::Blowfish $key;

This creates a new Crypt::Blowfish BlockCipher object, using $key, where $key is a key of keysize() bytes.

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

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

EXAMPLE

        my $key = pack("H16", "0123456789ABCDEF");
        my $cipher = new Crypt::Blowfish $key;
        my $ciphertext = $cipher->encrypt("plaintex");  # NB - 8 bytes
        print unpack("H16", $ciphertext), "\n";

PLATFORMS

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

NOTES

To use the CBC mode, you must use Crypt::CBC version 1.22 or higher.

SEE ALSO

Crypt::CBC, Crypt::DES, Crypt::IDEA

Bruce Schneier, Applied Cryptography, 1995, Second Edition, published by John Wiley & Sons, Inc.

COPYRIGHT

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.

AUTHOR

Original algorithm, Bruce Shneier. Original implimentation, A.M. Kuchling. Original Perl impilmentation, Systemics Ltd.

Current revision and maintainer: Dave Paris <amused@pobox.com>

THANKS

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.