NAME

SMB::Crypt - Fallback implementations of cryptography algorithms for SMB

SYNOPSIS

use SMB::Crypt qw(md4 md5);

my $digest1 = md4($data);

my $digest2 = md5($data);

ABSTRACT

This module provides fallback implementations for DES, MD4 and MD5 in pure perl to reduce dependence on non-standard perl modules.

However it is recommended to install Crypt::DES, Digest::MD4 and Digest::MD5 modules to get improved performance.

EXPORTED FUNCTIONS

By default, functions des_crypt56, md4, md5 and hmac_md5 are exported using the standard Exporter mechanism.

des_crypt56 EIGHT_BYTE_INPUT SEVEN_BYTE_KEY_STR [FORWARD=1]

Returns output of eight bytes that is a permutation of the input according to a key.

If Crypt::DES is found, it is used, otherwise pure perl fallback implemenation is used.

md4 DATA

Returns digest of 16 bytes, similar to Digest::MD4::md4.

If Digest::MD4 is found, it is used, otherwise pure perl fallback implemenation is used.

md5 DATA ...

Returns digest of 16 bytes, similar to Digest::MD5::md5.

If Digest::MD5 is found, it is used, otherwise pure perl fallback implemenation is used.

hmac_md5 DATA KEY

Returns digest of 16 bytes, similar to Digest::HMAC_MD5::hmac_md5. Uses md5 internally.

AUTHOR

Mikhael Goikhman <migo@cpan.org>

ACKNOWLEGDEMENTS

Ported from samba project.