.\" Automatically generated by Pod::Man 4.14 (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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 3pm" .TH Crypt::PasswdMD5 3pm "2022-11-27" "perl v5.36.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(CW\*(C`apache_md5_crypt()\*(C'\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(CW\*(C`unix_md5_crypt()\*(C'\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 \s-1NO WARRANTY.\s0 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 \*(L"unix_md5_crypt($password, \f(CW$salt\fR)\*(R". .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 \s-1CPAN\s0 bug tracker at .PP .SH "AUTHOR" .IX Header "AUTHOR" Luis E. Muñoz . .PP Maintenance by Ron Savage as of V 1.40.