Codebase list libcrypt-blowfish-perl / HEAD
HEAD

Tree @HEAD (Download .tar.gz)

This is Crypt::Blowfish version 2.11, an XS-based implementation of the
Blowfish cryptography algorithm designed by Bruce Schneier.  It's designed
to take full advantage of Crypt::CBC when desired.  Blowfish keys may be
up to 448 bits (56 bytes) long.  This module builds on nearly every platform
that Perl itself does (see Notes for exceptions).

Prerequisites
-------------

For the full test suite to run, Crypt::CBC, version 1.22 or higher
is required (recommended is 1.25 or higher), however this module 
is not mandatory for standalone Blowfish use.  

Installing Crypt::Blowfish
--------------------------

nothing unusual:

	1. perl Makefile.PL
	2. make
	3. make test
	4. make install

Notes
-----

This module has been tested successfully against the following:
Linux 2.0.X (x86)
Linux 2.2.X (x86, PPC, Alpha, m68k)
Linux 2.4.X (x86)
Solaris 2.5.1 and 2.7 (SPARC)
FreeBSD 3.3 and 3.4 (x86), 4.0 (alpha)
HP-UX B.10.20
DEC OSF 5.0
AIX spbuild 3 4
Win32 (NT4/SP5, using VC++5.0/VC++6.0)
OpenVMS (DEC C V6.0-001 / Alpha V7.1-2  with MMK make utility)
Mac OS X 10.4.X

Perl 5.004_01, 5.004_04, 5.005_03, 5.6.0, 5.6.1, 5.8.*

Please send other successful OS/platform combinations to:
amused@pobox.com . Thanks.

Patches for MacOS welcomed.

Being an XS implimentation, Crypt::Blowfish is exceptionally faster
than Blowfish_PP (a pure Perl implimentation).  Internal testing 
displayed a difference of 400 times faster when doing complete 
cipher generation and encryption.  Using a cached cipher resulted 
in 25 times faster than the pure Perl implimentation. (all machines 
idled prior to tests below)

In the case where this module won't build for you, please try the
Crypt::Blowfish_PP module - the Pure Perl implimentation.

Thanks to Thomas Kratz for the Win32 fixup and VMS report.
Thanks to Sandro Bonazzola for prompting code cleanup.


Performance
-----------

Typical results on a P4 3.0GHz Linux machine:
Under: Perl-v5.10.0: 
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles:  0 wallclock secs ( 0.36 usr +  0.00 sys =  0.36 CPU)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles:  1 wallclock secs ( 0.35 usr +  0.00 sys =  0.35 CPU)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.05 usr +  0.00 sys =  0.05 CPU)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.04 usr +  0.00 sys =  0.04 CPU)


Typical results on a PII-400 Linux machine:
Under  Perl-5.005_03:
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles:  4 wallclock secs ( 3.92 usr +  0.03 sys =  3.95 CPU)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles:  4 wallclock secs ( 3.96 usr +  0.01 sys =  3.97 CPU)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.22 usr +  0.00 sys =  0.22 CPU)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  1 wallclock secs ( 0.21 usr +  0.00 sys =  0.21 CPU)


Typical results from a 270Mhz UltraSPARC IIi (Ultra5 workstation)
Under  Perl-5.005_03
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles:  5 wallclock secs ( 4.05 usr +  0.11 sys =  4.16 CPU)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles:  4 wallclock secs ( 4.06 usr +  0.12 sys =  4.18 CPU)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.60 usr +  0.00 sys =  0.60 CPU)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  1 wallclock secs ( 0.63 usr +  0.00 sys =  0.63 CPU)


Typical results from a PIII-550 Linux machine:
Under  Perl-5.005_03
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles:  3 wallclock secs ( 2.95 usr +  0.00 sys =  2.95 CPU)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles:  3 wallclock secs ( 2.93 usr +  0.00 sys =  2.93 CPU)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.17 usr +  0.00 sys =  0.17 CPU)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.16 usr +  0.00 sys =  0.16 CPU)


Typical results from AIX machine:
Under  Perl-5.004_01
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles: 13 secs (11.77 usr  0.08 sys = 11.85 cpu)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles: 19 secs (11.98 usr  0.04 sys = 12.02 cpu)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  2 secs ( 1.11 usr  0.00 sys =  1.11 cpu)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  1 secs ( 1.04 usr  0.00 sys =  1.04 cpu)


Typical results for Alpha PCA56 (533Mhz) Linux machine:
Under  Perl-5.005_03
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles:  3 wallclock secs ( 2.68 usr +  0.01 sys =  2.69 CPU)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles:  3 wallclock secs ( 2.71 usr +  0.01 sys =  2.73 CPU)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.52 usr +  0.00 sys =  0.52 CPU)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  1 wallclock secs ( 0.58 usr +  0.00 sys =  0.58 CPU)


Typical results for m68k (33Mhz 68040) Linux machine:
Under  Perl-5.005_03
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles: 104 wallclock secs (97.26 usr +  2.50 sys = 99.76 CPU)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles: 102 wallclock secs (97.37 usr +  1.77 sys = 99.14 CPU)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  8 wallclock secs ( 7.20 usr +  0.09 sys =  7.29 CPU)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  7 wallclock secs ( 7.37 usr +  0.04 sys =  7.41 CPU)


Typical results for x86/PPro (dual 200Mhz PPro) Windows machine:
Under  Perl-5.005_02
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles: 8 wallclock secs ( 8.27 usr +  0.00 sys =  8.27 CPU)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles: 9 wallclock secs ( 8.25 usr +  0.00 sys =  8.25 CPU)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.69 usr +  0.00 sys =  0.69 CPU)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  1 wallclock secs ( 0.69 usr +  0.00 sys =  0.69 CPU)


Typical results for G4/1.2Ghz Mac OS X 10.4.X iBook:
Under  Perl-5.8.6 built for darwin-thread-multi-2level
Running standard mode speed tests.. encrypting with non-cached cipher
5,000 cycles:  1 wallclock secs ( 0.60 usr +  0.00 sys =  0.60 CPU)

Running standard mode speed tests.. decrypting with non-cached cipher
5,000 cycles:  0 wallclock secs ( 0.59 usr +  0.01 sys =  0.60 CPU)

Running standard mode speed tests.. encrypting with cached cipher
10,000 cycles:  0 wallclock secs ( 0.11 usr +  0.00 sys =  0.11 CPU)

Running standard mode speed tests.. decrypting with cached cipher
10,000 cycles:  1 wallclock secs ( 0.10 usr +  0.00 sys =  0.10 CPU)


Dave Paris - W3Works, LLC
<amused@pobox.com>