Password Hashing
Password hashing is a one-way process that converts a plaintext password into a fixed-length string of characters called a hash, using a cryptographic hashing algorithm. Because the operation cannot be reversed, systems can store the hash instead of the actual password, so the original password is not exposed if the stored data is compromised. When a user logs in, the system hashes the entered password and compares it to the stored hash rather than comparing the plaintext directly.
Password hashing applies a cryptographic hash function to a plaintext password to produce a fixed-size, one-way digest that is quick to compute but computationally hard to reverse. Hashing differs fundamentally from encryption: it is one-directional and there is no key that recovers the original input, which is why hashing rather than reversible encryption is the standard approach for password storage. In most deployments, a per-password salt is combined with the input before hashing to defeat precomputed lookup and rainbow-table attacks, and purpose-built password hashing algorithms (for example bcrypt) are typically preferred over fast general-purpose hashes because their deliberate computational cost slows brute-force attempts. Verification is performed by hashing a submitted password under the same parameters and comparing the resulting digest to the stored value. Note that the specific algorithm choice, salting, and work-factor configuration vary by deployment; this entry does not cover authentication protocol flows or credential transport, which are separate concerns.
Why it matters
Password hashing is the baseline defense for credential storage. Because a hash is a one-way digest that cannot be reversed to recover the original input, a system that stores hashes rather than plaintext passwords does not directly expose usable credentials if its stored data is compromised. This matters because credential databases are a frequent target, and the difference between storing plaintext and storing properly hashed passwords often determines whether a data exposure becomes an immediate account-takeover event or a slower, harder problem for an attacker.
The protection hashing provides is not absolute and depends heavily on configuration. General-purpose cryptographic hashes are designed to be fast to compute, which also makes them faster for an attacker to guess against at scale. For this reason, purpose-built password hashing algorithms such as bcrypt are typically preferred because their deliberate computational cost slows brute-force attempts. Similarly, a per-password salt is used in most deployments to defeat precomputed lookup and rainbow-table attacks; without it, identical passwords produce identical hashes and become vulnerable to precomputed attacks.
For security architects and engineers, the practical takeaway is that adopting hashing is necessary but not sufficient. The specific algorithm choice, salting practice, and work-factor configuration collectively determine how much real protection the stored hashes offer, and these parameters need to be revisited as computational capabilities change.
Who it's relevant to
Inside Password Hashing
Common questions
Answers to the questions practitioners most commonly ask about Password Hashing.