libdigest-hmac-perl-1.03+dfsg.orig/0000755000175000017500000000000011613344147016151 5ustar salvisalvilibdigest-hmac-perl-1.03+dfsg.orig/Changes0000644000175000017500000000066111613317606017447 0ustar salvisalvi2011-07-25 Gisle Aas Release 1.03 Depend on Digest::SHA instead of Digest::SHA1 [RT#69776] Document the blocksize argument [RT#14551] 2010-01-10 Gisle Aas Release 1.02 Give the distribution a META.yml file 2000-03-13 Gisle Aas Release 1.01 Broken out of the Digest-MD5-2.12 distribution and made into a separate dist. libdigest-hmac-perl-1.03+dfsg.orig/META.yml0000644000175000017500000000113411613317635017423 0ustar salvisalvi--- #YAML:1.0 name: Digest-HMAC version: 1.03 abstract: Keyed-Hashing for Message Authentication author: - Gisle Aas license: perl distribution_type: module configure_requires: ExtUtils::MakeMaker: 0 build_requires: ExtUtils::MakeMaker: 0 requires: Digest::MD5: 2 Digest::SHA: 1 perl: 5.004 no_index: directory: - t - inc generated_by: ExtUtils::MakeMaker version 6.57_05 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 libdigest-hmac-perl-1.03+dfsg.orig/t/0000755000175000017500000000000011613344147016414 5ustar salvisalvilibdigest-hmac-perl-1.03+dfsg.orig/MANIFEST0000644000175000017500000000026511613344147017305 0ustar salvisalviChanges MANIFEST Makefile.PL README lib/Digest/HMAC.pm lib/Digest/HMAC_MD5.pm lib/Digest/HMAC_SHA1.pm META.yml Module meta-data (added by MakeMaker) libdigest-hmac-perl-1.03+dfsg.orig/Makefile.PL0000644000175000017500000000175011613314605020122 0ustar salvisalvirequire 5.004; use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'Digest::HMAC', 'VERSION_FROM' => 'lib/Digest/HMAC.pm', 'ABSTRACT_FROM' => 'lib/Digest/HMAC.pm', 'PREREQ_PM' => { 'Digest::MD5' => 2.00, 'Digest::SHA' => 1.00, }, 'AUTHOR' => 'Gisle Aas ', 'LICENSE' => 'perl', 'MIN_PERL_VERSION' => 5.004, ); BEGIN { # compatibility with older versions of MakeMaker my $developer = -f ".gitignore"; my %mm_req = ( LICENCE => 6.31, META_MERGE => 6.45, META_ADD => 6.45, MIN_PERL_VERSION => 6.48, ); undef(*WriteMakefile); *WriteMakefile = sub { my %arg = @_; for (keys %mm_req) { unless (eval { ExtUtils::MakeMaker->VERSION($mm_req{$_}) }) { warn "$_ $@" if $developer; delete $arg{$_}; } } ExtUtils::MakeMaker::WriteMakefile(%arg); }; } libdigest-hmac-perl-1.03+dfsg.orig/lib/0000755000175000017500000000000011613344147016717 5ustar salvisalvilibdigest-hmac-perl-1.03+dfsg.orig/lib/Digest/0000755000175000017500000000000011613317635020140 5ustar salvisalvilibdigest-hmac-perl-1.03+dfsg.orig/lib/Digest/HMAC_MD5.pm0000644000175000017500000000213211154225260021641 0ustar salvisalvipackage Digest::HMAC_MD5; $VERSION="1.01"; use strict; use Digest::MD5 qw(md5); use Digest::HMAC qw(hmac); # OO interface use vars qw(@ISA); @ISA=qw(Digest::HMAC); sub new { my $class = shift; $class->SUPER::new($_[0], "Digest::MD5", 64); } # Functional interface require Exporter; *import = \&Exporter::import; use vars qw(@EXPORT_OK); @EXPORT_OK=qw(hmac_md5 hmac_md5_hex); sub hmac_md5 { hmac($_[0], $_[1], \&md5, 64); } sub hmac_md5_hex { unpack("H*", &hmac_md5) } 1; __END__ =head1 NAME Digest::HMAC_MD5 - Keyed-Hashing for Message Authentication =head1 SYNOPSIS # Functional style use Digest::HMAC_MD5 qw(hmac_md5 hmac_md5_hex); $digest = hmac_md5($data, $key); print hmac_md5_hex($data, $key); # OO style use Digest::HMAC_MD5; $hmac = Digest::HMAC_MD5->new($key); $hmac->add($data); $hmac->addfile(*FILE); $digest = $hmac->digest; $digest = $hmac->hexdigest; $digest = $hmac->b64digest; =head1 DESCRIPTION This module provide HMAC-MD5 hashing. =head1 SEE ALSO L, L, L =head1 AUTHOR Gisle Aas =cut libdigest-hmac-perl-1.03+dfsg.orig/lib/Digest/HMAC_SHA1.pm0000644000175000017500000000221311613317371021755 0ustar salvisalvipackage Digest::HMAC_SHA1; $VERSION="1.03"; use strict; use Digest::SHA qw(sha1); use Digest::HMAC qw(hmac); # OO interface use vars qw(@ISA); @ISA=qw(Digest::HMAC); sub new { my $class = shift; $class->SUPER::new($_[0], "Digest::SHA", 64); # Digest::SHA defaults to SHA-1 } # Functional interface require Exporter; *import = \&Exporter::import; use vars qw(@EXPORT_OK); @EXPORT_OK=qw(hmac_sha1 hmac_sha1_hex); sub hmac_sha1 { hmac($_[0], $_[1], \&sha1, 64); } sub hmac_sha1_hex { unpack("H*", &hmac_sha1) } 1; __END__ =head1 NAME Digest::HMAC_SHA1 - Keyed-Hashing for Message Authentication =head1 SYNOPSIS # Functional style use Digest::HMAC_SHA1 qw(hmac_sha1 hmac_sha1_hex); $digest = hmac_sha1($data, $key); print hmac_sha1_hex($data, $key); # OO style use Digest::HMAC_SHA1; $hmac = Digest::HMAC_SHA1->new($key); $hmac->add($data); $hmac->addfile(*FILE); $digest = $hmac->digest; $digest = $hmac->hexdigest; $digest = $hmac->b64digest; =head1 DESCRIPTION This module provide HMAC-SHA-1 hashing. =head1 SEE ALSO L, L, L =head1 AUTHOR Gisle Aas =cut libdigest-hmac-perl-1.03+dfsg.orig/lib/Digest/HMAC.pm0000644000175000017500000000551111613317403021201 0ustar salvisalvipackage Digest::HMAC; $VERSION = "1.03"; use strict; # OO interface sub new { my($class, $key, $hasher, $block_size) = @_; $block_size ||= 64; $key = $hasher->new->add($key)->digest if length($key) > $block_size; my $self = bless {}, $class; $self->{k_ipad} = $key ^ (chr(0x36) x $block_size); $self->{k_opad} = $key ^ (chr(0x5c) x $block_size); $self->{hasher} = $hasher->new->add($self->{k_ipad}); $self; } sub reset { my $self = shift; $self->{hasher}->reset->add($self->{k_ipad}); $self; } sub add { my $self = shift; $self->{hasher}->add(@_); $self; } sub addfile { my $self = shift; $self->{hasher}->addfile(@_); $self; } sub _digest { my $self = shift; my $inner_digest = $self->{hasher}->digest; $self->{hasher}->reset->add($self->{k_opad}, $inner_digest); } sub digest { shift->_digest->digest; } sub hexdigest { shift->_digest->hexdigest; } sub b64digest { shift->_digest->b64digest; } # Functional interface require Exporter; *import = \&Exporter::import; use vars qw(@EXPORT_OK); @EXPORT_OK = qw(hmac hmac_hex); sub hmac { my($data, $key, $hash_func, $block_size) = @_; $block_size ||= 64; $key = &$hash_func($key) if length($key) > $block_size; my $k_ipad = $key ^ (chr(0x36) x $block_size); my $k_opad = $key ^ (chr(0x5c) x $block_size); &$hash_func($k_opad, &$hash_func($k_ipad, $data)); } sub hmac_hex { unpack("H*", &hmac); } 1; __END__ =head1 NAME Digest::HMAC - Keyed-Hashing for Message Authentication =head1 SYNOPSIS # Functional style use Digest::HMAC qw(hmac hmac_hex); $digest = hmac($data, $key, \&myhash); print hmac_hex($data, $key, \&myhash); # OO style use Digest::HMAC; $hmac = Digest::HMAC->new($key, "Digest::MyHash"); $hmac->add($data); $hmac->addfile(*FILE); $digest = $hmac->digest; $digest = $hmac->hexdigest; $digest = $hmac->b64digest; =head1 DESCRIPTION HMAC is used for message integrity checks between two parties that share a secret key, and works in combination with some other Digest algorithm, usually MD5 or SHA-1. The HMAC mechanism is described in RFC 2104. HMAC follow the common C interface, but the constructor takes the secret key and the name of some other simple C as argument. The hmac() and hmac_hex() functions and the Digest::HMAC->new() constructor takes an optional $blocksize argument as well. The HMAC algorithm assumes the digester to hash by iterating a basic compression function on blocks of data and the $blocksize should match the byte-length of such blocks. The default $blocksize is 64 which is suitable for the MD5 and SHA-1 digest functions. For stronger algorithms the blocksize probably needs to be increased. =head1 SEE ALSO L, L RFC 2104 =head1 AUTHORS Graham Barr , Gisle Aas =cut libdigest-hmac-perl-1.03+dfsg.orig/README0000644000175000017500000000125711154225260017030 0ustar salvisalviHMAC is used for message integrity checks between two parties that share a secret key, and works in combination with some other Digest algorithm, usually MD5 or SHA-1. The HMAC mechanism is described in RFC 2104. The Digest::HMAC module follow the common Digest:: interface, but the constructor takes the secret key and the name of some other simple Digest:: module as argument. You will need perl version 5.004 or better to install these modules. The Digest::MD5 module and Digest::SHA1 module must be installed. Copyright 1998-2001 Gisle Aas. Copyright 1998 Graham Barr. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.