Ted Anderson > Digest-Perl-MD4 > Digest::Perl::MD4

Download:
Digest-Perl-MD4-1.4.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.4   Source  

NAME ^

Digest::Perl::MD4 - Perl implementation of Ron Rivests MD4 Algorithm

DISCLAIMER ^

This is not C-code interface (like Digest::MD5) but a Perl-only implementation of MD4 (like Digest::Perl::MD5). Because of this, it is slow but avoids platform specific complications. For efficiency you should use Digest::MD4 instead of this module if it is available.

SYNOPSIS ^

 # Functional style
 use Digest::Perl::MD4 qw(md4 md4_hex md4_base64);

 $hash = md4 $data;
 $hash = md4_hex $data;
 $hash = md4_base64 $data;


 # OO style
 use Digest::Perl::MD4;

 $ctx = Digest::Perl::MD4->new;

 $ctx->add($data);
 $ctx->addfile(*FILE);

 $digest = $ctx->digest;
 $digest = $ctx->hexdigest;
 $digest = $ctx->b64digest;

DESCRIPTION ^

This modules has the same interface as Digest::MD5. It should be compatible with the Digest::MD4 module written by Mike McCauley <mikem@open.com.au>.

EXAMPLES ^

The simplest way to use this library is to import the md4_hex() function (or one of its cousins):

    use Digest::Perl::MD4 'md4_hex';
    print 'Digest is ', md4_hex('foobarbaz'), "\n";

The above example would print out the message

    Digest is b2b2b528f632f554ae9cb2c02c904eeb

provided that the implementation is working correctly. The same checksum can also be calculated in OO style:

    use Digest::Perl::MD4;

    $md4 = Digest::Perl::MD4->new;
    $md4->add('foo', 'bar');
    $md4->add('baz');
    $digest = $md4->hexdigest;

    print "Digest is $digest\n";

LIMITATIONS ^

This implementation of the MD4 algorithm has some limitations:

SEE ALSO ^

Digest::MD5

RFC 1320

COPYRIGHT ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

 Copyright 2002 Ted Anderson.
 Copyright 2000 Christian Lackas, Imperia Software Solutions.
 Copyright 1998-1999 Gisle Aas.
 Copyright 1995-1996 Neil Winton.
 Copyright 1991-1992 RSA Data Security, Inc.

The MD4 algorithm is defined in RFC 1320. The basic C code implementing the algorithm is derived from that in the RFC and is covered by the following copyright:

This copyright does not prohibit distribution of any version of Perl containing this extension under the terms of the GNU or Artistic licenses.

AUTHORS ^

The original MD5 interface was written by Neil Winton <N.Winton@axion.bt.co.uk>.

Digest::MD5 was made by Gisle Aas <gisle@aas.no>.

Digest::Perl::MD5 was made by Christian Lackas <delta@clackas.de>.

MD5 in 8 lines of perl5 implemented and optimized for size by John Allen[3] and collected by Adam Back[5] <adam@cypherspace.org>. Conversion to MD4 algorithm by Ted Anderson <tedanderson@mindspring.com>.

Footnotes ^

[3]

allen@grumman.com

[5]

http://www.cypherspace.org/~adam/

syntax highlighting: