Crypt-DES

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

positive.  Building on Win32 with VC++6 may prove
problematic.  Complaints about build problems on
Win32 will be sent to /dev/null.

Please report any other successful OS/Platform 
combinations to amused@pobox.com.  Thank you.

What you can expect in the way of speed:

Linux/x86 dual PII400
non-cached cipher speed test.  5000 encrypt iterations
 0 wallclock secs ( 0.52 usr +  0.01 sys =  0.53 CPU)
non-cached cipher speed test.  5000 decrypt iterations
 1 wallclock secs ( 0.52 usr +  0.01 sys =  0.53 CPU)
cached cipher speed test.  10000 encrypt iterations
 0 wallclock secs ( 0.20 usr +  0.00 sys =  0.20 CPU)
cached cipher speed test.  10000 decrypt iterations
 0 wallclock secs ( 0.22 usr +  0.00 sys =  0.22 CPU)

Windows NT4(SP6)/x86 dual PPro 200
non-cached cipher speed test.  5000 encrypt iterations
 1 wallclock secs ( 1.25 usr +  0.00 sys =  1.25 CPU)
non-cached cipher speed test.  5000 decrypt iterations
 2 wallclock secs ( 1.22 usr +  0.00 sys =  1.22 CPU)
cached cipher speed test.  10000 encrypt iterations
 0 wallclock secs ( 0.58 usr +  0.00 sys =  0.58 CPU)
cached cipher speed test.  10000 decrypt iterations
 1 wallclock secs ( 0.59 usr +  0.00 sys =  0.59 CPU)

Solaris7/SPARC UltraSPARCIIi 277Mhz
non-cached cipher speed test.  5000 encrypt iterations
 1 wallclock secs ( 1.08 usr +  0.20 sys =  1.28 CPU)
non-cached cipher speed test.  5000 decrypt iterations
 2 wallclock secs ( 1.14 usr +  0.12 sys =  1.26 CPU)
cached cipher speed test.  10000 encrypt iterations
 0 wallclock secs ( 0.52 usr +  0.00 sys =  0.52 CPU)
cached cipher speed test.  10000 decrypt iterations
 1 wallclock secs ( 0.50 usr +  0.00 sys =  0.50 CPU)

test.pl  view on Meta::CPAN

my $fp = sprintf("%0.2f",(($tt / $suc) * 100)) unless $suc == 0;
if($suc == 0) { $fp = '0.00' }
my $td0 = timediff($t1,$t0);
my $ts0 = timestr($td0);
print "$tt basic tests ran in $ts0\n";
print "$suc of $tt tests passed ($fp\%)\n";
if($fail > 0) {
    print "Not all tests successful.  Please attempt to rebuild the package\n";
} else {
    print "\nRunning speed tests...\n";
    print "\nnon-cached cipher speed test.  5000 encrypt iterations\n";
    my $t2 = new Benchmark;
    for(1..5000) {
	my $cipher = new Crypt::DES(pack("H*",'1c587f1c13924fef'));
	$cipher->encrypt(pack("H*",'305532286d6f295a'));
    }
    my $t3 = new Benchmark;
    my $td1 = timediff($t3,$t2);
    my $ts1 = timestr($td1);
    print "$ts1\nok 343\n";

    print "\nnon-cached cipher speed test.  5000 decrypt iterations\n";
    my $t4 = new Benchmark;
    for(1..5000) {
        my $cipher = new Crypt::DES(pack("H*",'1c587f1c13924fef'));
        $cipher->decrypt(pack("H*",'63fac0d034d9f793'));
    }
    my $t5 = new Benchmark;
    my $td2 = timediff($t5,$t4);
    my $ts2 = timestr($td2);
    print "$ts2\nok 344\n";

    print "\ncached cipher speed test.  10000 encrypt iterations\n";
    {
    my $t6 = new Benchmark;
    my $cipher = new Crypt::DES(pack("H*",'1c587f1c13924fef'));
    for(1..10000) {
        $cipher->encrypt(pack("H*",'305532286d6f295a'));
    }
    my $t7 = new Benchmark;
    my $td3 = timediff($t7,$t6);
    my $ts3 = timestr($td3);
    print "$ts3\nok 345\n";
    }

    print "\ncached cipher speed test.  10000 decrypt iterations\n";
    {
    my $t8 = new Benchmark;
    my $cipher = new Crypt::DES(pack("H*",'1c587f1c13924fef'));
    for(1..10000) {
        $cipher->decrypt(pack("H*",'63fac0d034d9f793'));
    }
    my $t9 = new Benchmark;
    my $td4 = timediff($t9,$t8);
    my $ts4 = timestr($td4);
    print "$ts4\nok 346\n";



( run in 0.661 second using v1.01-cache-2.11-cpan-96521ef73a4 )