Password Hashing Algorithms Reference
Unlike ordinary cryptographic hashes, password hashing key derivation functions (KDFs) are deliberately slow and resource-intensive. They defend against dictionary and rainbow-table attacks by forcing an attacker to consume significant memory and CPU time per guess. Below are both modern OWASP-recommended standards and historical schemes for compatibility with existing systems.
Argon2id
RFC 9106 Winner of the Password Hashing Competition (2015). Combines side-channel resistance (Argon2i) with GPU/ASIC attack resistance (Argon2d). Recommended by OWASP as the default password hashing algorithm. Tunable parameters: memory, iterations, and parallelism.
bcrypt
Blowfish Adaptive hash function based on the Blowfish cipher (Niels Provos and David Mazières). Uses the expensive EksBlowfish key schedule; cost is tunable as a power-of-two iteration count. The de facto industry standard on Unix and web applications for over 25 years.
scrypt
RFC 7914 Key derivation function by Colin Percival (RFC 7914). Its core idea is to require a large working memory (N), making parallel brute-force on GPUs and ASICs economically unviable. Parameters: N (cost), r (block size), p (parallelism).
PBKDF2
NIST SP 800-132 Password-Based Key Derivation Function 2 (RFC 8018, NIST SP 800-132). Iteratively applies HMAC to password and salt. Simple and widely supported, but weaker than Argon2id and scrypt against specialized hardware. At least 600,000 iterations are recommended for SHA-256.
SHA-crypt / MD5crypt / apr1 / phpass
Unix / Apache / PHP Family of schemes from /etc/shadow and web-server configs. SHA-512crypt ($6$) and SHA-256crypt ($5$) are glibc standards, MD5crypt ($1$) is a legacy BSD format, Apache MD5 ($apr1$) is the htpasswd format, and phpass ($P$) is a historic scheme from phpBB2 and WordPress. Use only for backward compatibility.
NTLM
Windows Windows password hash format (MD4 of UTF-16LE). Used in NTLM and NetNTLM protocols for Active Directory and SMB authentication. Do not use for storing new passwords — MD4 is fully broken.
SCRAM-SHA-256
RFC 7677 Salted Challenge Response Authentication Mechanism (RFC 5802, RFC 7677). Stores SaltedPassword as StoredKey = H(ClientKey) and ServerKey = HMAC(SaltedPassword, "Server Key"), allowing the server to authenticate a client without storing the plaintext password. The standard in PostgreSQL and MongoDB.
CRAM-SHA-1
RFC 2195 Challenge-Response Authentication Mechanism (RFC 2195). A simple authentication scheme: the server sends a random string, and the client replies with HMAC-SHA-1(password, challenge). Used in IMAP, POP3, and SMTP SASL.
MySQL authentication
caching_sha2 / native Two MySQL authentication schemes. caching_sha2_password (MySQL 8+ default) applies SHA-256 twice to the password. mysql_native_password (legacy) applies SHA-1 twice and is the standard for PHP applications prior to MySQL 8.