SYNOPSIS

    use Crypt::PasswdMD5;

    $cryptedpassword = unix_md5_crypt($password, $salt);
    $apachepassword = apache_md5_crypt($password, $salt);

DESCRIPTION

the \*(C`unix_md5_crypt()\*(C' provides a crypt()-compatible interface to the rather new MD5-based crypt() function found in modern operating systems. It's based on the implementation found on FreeBSD 2.2.[56]-RELEASE and contains the following license in it:

"THE BEER-WARE LICENSE" (Revision 42): <[email protected]> wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp

\*(C`apache_md5_crypt()\*(C' provides a function compatible with Apache's \*(C`.htpasswd\*(C' files. This was contributed by Bryan Hart <[email protected]>. As suggested by William A. Rowe, Jr. <[email protected]>, it is exported by default.

For both functions, if a salt value is not supplied, a random salt will be generated. Contributed by John Peacock <[email protected]>.

\s-1EXPORT\s0

None by default.

HISTORY

$Id: PasswdMD5.pm,v 1.3 2004/02/17 11:21:38 lem Exp $

19980710 [email protected]: Initial release 19990402 [email protected]: Added apache_md5_crypt to create a valid hash for use in .htpasswd files 20001006 [email protected]: Requested apache_md5_crypt to be exported by default. 20010706 [email protected]: Use Digest::MD5 instead of the (obsolete) MD5.

$Log: PasswdMD5.pm,v $ Revision 1.3 2004/02/17 11:21:38 lem Modified the \s-1POD\s0 so that \s-1ABSTRACT\s0 can work Added usage example for apache_md5_crypt()

Revision 1.2 2004/02/17 11:04:35 lem Added patch for random salts from John Peacock (Thanks John!) De-MS-DOS-ified the file Replaced some '' with q// to make Emacs color highlighting happy Added \s-1CVS\s0 docs Completed the missing sections of the \s-1POD\s0 documentation Changed my email address to the Perl-related one for consistency The file is now encoded in \s-1ISO-8859-1\s0

LICENSE AND WARRANTY

This code and all accompanying software comes with \s-1NO\s0 \s-1WARRANTY\s0. You use it at your own risk.

This code and all accompanying software can be used freely under the same terms as Perl itself.

AUTHOR

Luis E. Mu\[ntilde]oz <[email protected]>

RELATED TO Crypt::PasswdMD5…

perl\|(1).