Todd Rinaldo > Crypt-RIPEMD160-0.05 > Crypt::RIPEMD160::MAC

Download:
Crypt-RIPEMD160-0.05.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Crypt::RIPEMD160::MAC - Perl extension for RIPEMD-160 MAC function

SYNOPSIS ^

    use Crypt::RIPEMD160::MAC;
    
    $key = "This is the secret key";

    $mac = new Crypt::RIPEMD160::MAC($key);

    $mac->reset();
    
    $mac->add(LIST);
    $mac->addfile(HANDLE);
    
    $digest = $mac->mac();
    $string = $mac->hexmac();

DESCRIPTION ^

The Crypt::RIPEMD160 module allows you to use the RIPEMD160 Message Digest algorithm from within Perl programs.

EXAMPLES ^

    use Crypt::RIPEMD160;
    
    $ripemd160 = new Crypt::RIPEMD160;
    $ripemd160->add('foo', 'bar');
    $ripemd160->add('baz');
    $digest = $ripemd160->digest();
    
    print("Digest is " . unpack("H*", $digest) . "\n");

The above example would print out the message

    Digest is f137cb536c05ec2bc97e73327937b6e81d3a4cc9

provided that the implementation is working correctly.

AUTHOR ^

The RIPEMD-160 interface was written by Christian H. Geuer (christian.geuer@crypto.gun.de).

SEE ALSO ^

MD5(3pm) and SHA(1).

syntax highlighting: