.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Crypt::PasswdMD5 3" .TH Crypt::PasswdMD5 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Crypt::PasswdMD5 \- Provide interoperable MD5\-based crypt() functions .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use strict; \& use warnings; \& \& use Crypt::PasswdMD5; \& \& my($password) = \*(Aqseekrit\*(Aq; \& my($salt) = \*(Aqpepperoni\*(Aq; \& my($unix_crypted) = unix_md5_crypt($password, $salt); \& my($apache_crypted) = apache_md5_crypt($password, $salt); \& \& Or: \& \& use strict; \& use warnings; \& \& use Crypt::PasswdMD5 \*(Aqrandom_md5_salt\*(Aq; \& \& my($length) = 7; \& my($salt_1) = random_md5_salt($length); \& my($salt_2) = random_md5_salt(); # Default to $length == 8. .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CWapache_md5_crypt()\fR provides a function compatible with Apache's \f(CW\*(C`.htpasswd\*(C'\fR files. This was contributed by Bryan Hart . This function is exported by default. .PP The \f(CWunix_md5_crypt()\fR provides a \fBcrypt()\fR\-compatible interface to the rather new MD5\-based \fBcrypt()\fR function found in modern operating systems. It's based on the implementation found on FreeBSD 2.2.[56]\-RELEASE. This function is also exported by default. .PP For both functions, if a salt value is not supplied, a random salt will be generated, using the function \fBrandom_md5_salt()\fR. This function is not exported by default. .SH "LICENSE AND WARRANTY" .IX Header "LICENSE AND WARRANTY" This code and all accompanying software comes with NO WARRANTY. You use it at your own risk. .PP This code and all accompanying software can be used freely under the same terms as Perl itself. .SH METHODS .IX Header "METHODS" .ie n .SS "apache_md5_crypt($password, $salt)" .el .SS "apache_md5_crypt($password, \f(CW$salt\fP)" .IX Subsection "apache_md5_crypt($password, $salt)" This sets a magic variable, and then passes all the calling parameters to "unix_md5_crypt($password, \f(CW$salt\fR)". .PP Returns an encrypted version of the given password. .PP Basically, it's a very poor choice for anything other than password authentication. .SS random_md5_salt([$length]) .IX Subsection "random_md5_salt([$length])" Here, [] indicate an optional parameter. .PP Returns a random salt of the given length. .PP The maximum length is 8. .PP If \f(CW$length\fR is omitted, it defaults to 8. .ie n .SS "unix_md5_crypt($password, $salt)" .el .SS "unix_md5_crypt($password, \f(CW$salt\fP)" .IX Subsection "unix_md5_crypt($password, $salt)" Returns an encrypted version of the given password. .PP Basically, it's a very poor choice for anything other than password authentication. .SH Repository .IX Header "Repository" .SH SUPPORT .IX Header "SUPPORT" Bugs should be reported via the CPAN bug tracker at .PP .SH AUTHOR .IX Header "AUTHOR" Luis E. Muñoz . .PP Maintenance by Ron Savage as of V 1.40.