Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

crypt

One-way password hashing using the system crypt(3) library.

Calls the system crypt(3) function. The SALT determines the hashing algorithm (DES, MD5, SHA-256, SHA-512, etc. depending on the platform). The result can be compared against a stored hash to verify a password without storing the plaintext.

Synopsis

my $hashed = crypt($plaintext, $salt);
if (crypt($input, $hashed) eq $hashed) { ... }  # verify

See Also

Digest::SHA, Digest::MD5