Module pwhash::md5_crypt [] [src]

MD5 based hash.

This algorithm was developed for FreeBSD to replace the aging DES crypt. It was adopted in various Linux distributions and saw wide use. Presently, it's considered insecure and shouldn't be used for new passwords.

Example

use pwhash::md5_crypt;

assert_eq!(md5_crypt::hash_with(
    "$1$5pZSV9va$azfrPr6af3Fc7dLblQXVa0",
    "password").unwrap(),
    "$1$5pZSV9va$azfrPr6af3Fc7dLblQXVa0");

Parameters

Hash Format

The format of the hash is $1${salt}${checksum}, where:

Constants

MAX_SALT_LEN

Maximium salt length.

Functions

hash [
Deprecated
]

Hash a password with a randomly generated salt.

hash_with [
Deprecated
]

Hash a password with user-provided parameters.

verify

Verify that the hash corresponds to a password.