sl@0: # sl@0: # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: # All rights reserved. sl@0: # This component and the accompanying materials are made available sl@0: # under the terms of the License "Eclipse Public License v1.0" sl@0: # which accompanies this distribution, and is available sl@0: # at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: # sl@0: # Initial Contributors: sl@0: # Nokia Corporation - initial contribution. sl@0: # sl@0: # Contributors: sl@0: # sl@0: # Description: sl@0: # sl@0: sl@0: package Digest::HMAC_MD4; sl@0: $VERSION="1.01"; sl@0: sl@0: use strict; sl@0: use Digest::MD4; sl@0: use Digest::HMAC qw(hmac); sl@0: sl@0: # OO interface sl@0: use vars qw(@ISA); sl@0: @ISA=qw(Digest::HMAC); sl@0: sub new sl@0: { sl@0: my $class = shift; sl@0: $class->SUPER::new($_[0], "Digest::MD4", 64); sl@0: } sl@0: sl@0: # Functional interface sl@0: require Exporter; sl@0: *import = \&Exporter::import; sl@0: use vars qw(@EXPORT_OK); sl@0: @EXPORT_OK=qw(hmac_md4 hmac_md4_hex); sl@0: sl@0: sub hmac_md4 sl@0: { sl@0: hmac($_[0], $_[1], \&md4, 64); sl@0: } sl@0: sl@0: sub hmac_md4_hex sl@0: { sl@0: unpack("H*", &hmac_md4) sl@0: } sl@0: sl@0: 1; sl@0: sl@0: __END__ sl@0: sl@0: =head1 NAME sl@0: sl@0: Digest::HMAC_MD4 - Keyed-Hashing for Message Authentication sl@0: sl@0: =head1 SYNOPSIS sl@0: sl@0: # Functional style sl@0: use Digest::HMAC_MD4 qw(hmac_md4 hmac_md4_hex); sl@0: $digest = hmac_md4($data, $key); sl@0: print hmac_md4_hex($data, $key); sl@0: sl@0: # OO style sl@0: use Digest::HMAC_MD4; sl@0: $hmac = Digest::HMAC_MD4->new($key); sl@0: sl@0: $hmac->add($data); sl@0: $hmac->addfile(*FILE); sl@0: sl@0: $digest = $hmac->digest; sl@0: $digest = $hmac->hexdigest; sl@0: $digest = $hmac->b64digest; sl@0: sl@0: =head1 DESCRIPTION sl@0: sl@0: This module provide HMAC-MD4 hashing. sl@0: sl@0: =head1 SEE ALSO sl@0: sl@0: L, ,L, L, L, L sl@0: sl@0: =head1 AUTHOR sl@0: sl@0: Paul Sinfield, from Gisle Aas 's MD5 code sl@0: sl@0: =cut