{
    "mode": "perldoc",
    "parameter": "Crypt::PasswdMD5",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3APasswdMD5/json",
    "generated": "2026-06-16T15:56:15Z",
    "synopsis": "use strict;\nuse warnings;\nuse Crypt::PasswdMD5;\nmy($password)       = 'seekrit';\nmy($salt)           = 'pepperoni';\nmy($unixcrypted)   = unixmd5crypt($password, $salt);\nmy($apachecrypted) = apachemd5crypt($password, $salt);\nOr:\nuse strict;\nuse warnings;\nuse Crypt::PasswdMD5 'randommd5salt';\nmy($length) = 7;\nmy($salt1) = randommd5salt($length);\nmy($salt2) = randommd5salt(); # Default to $length == 8.",
    "sections": {
        "NAME": {
            "content": "Crypt::PasswdMD5 - Provide interoperable MD5-based crypt() functions\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use strict;\nuse warnings;\n\nuse Crypt::PasswdMD5;\n\nmy($password)       = 'seekrit';\nmy($salt)           = 'pepperoni';\nmy($unixcrypted)   = unixmd5crypt($password, $salt);\nmy($apachecrypted) = apachemd5crypt($password, $salt);\n\nOr:\n\nuse strict;\nuse warnings;\n\nuse Crypt::PasswdMD5 'randommd5salt';\n\nmy($length) = 7;\nmy($salt1) = randommd5salt($length);\nmy($salt2) = randommd5salt(); # Default to $length == 8.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"apachemd5crypt()\" provides a function compatible with Apache's \".htpasswd\" files. This was\ncontributed by Bryan Hart <bryan@eai.com>. This function is exported by default.\n\nThe \"unixmd5crypt()\" provides a crypt()-compatible interface to the rather new MD5-based",
            "subsections": [
                {
                    "name": "crypt",
                    "content": "FreeBSD 2.2.[56]-RELEASE. This function is also exported by default.\n\nFor both functions, if a salt value is not supplied, a random salt will be generated, using the\nfunction randommd5salt(). This function is not exported by default.\n"
                }
            ]
        },
        "LICENSE AND WARRANTY": {
            "content": "This code and all accompanying software comes with NO WARRANTY. You use it at your own risk.\n\nThis code and all accompanying software can be used freely under the same terms as Perl itself.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "apachemd5crypt($password, $salt)\nThis sets a magic variable, and then passes all the calling parameters to\n\"unixmd5crypt($password, $salt)\".\n\nReturns an encrypted version of the given password.\n\nBasically, it's a very poor choice for anything other than password authentication.\n\nrandommd5salt([$length])\nHere, [] indicate an optional parameter.\n\nReturns a random salt of the given length.\n\nThe maximum length is 8.\n\nIf $length is omitted, it defaults to 8.\n\nunixmd5crypt($password, $salt)\nReturns an encrypted version of the given password.\n\nBasically, it's a very poor choice for anything other than password authentication.\n",
            "subsections": []
        },
        "Repository": {
            "content": "<https://github.com/ronsavage/Crypt-PasswdMD5.git>\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Bugs should be reported via the CPAN bug tracker at\n\n<https://github.com/ronsavage/Crypt-PasswdMD5/issues>\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Luis E. Muñoz <luismunoz@cpan.org>.\n\nMaintenance by Ron Savage <rsavage@cpan.org> as of V 1.40.\n",
            "subsections": []
        }
    },
    "summary": "Crypt::PasswdMD5 - Provide interoperable MD5-based crypt() functions",
    "flags": [],
    "examples": [],
    "see_also": []
}