Home / Blog / Developer & Web

Developer & Web

Password Hashing: Why a Plain Online SHA Digest Is Insufficient

Separate text checksums from password storage, understand salts and configurable cost, and test a password-hashing library without using real credentials.

Password Hashing: Why a Plain Online SHA Digest Is Insufficient

Identify the operation the page actually provides

The linked Hash Generator offers MD5, SHA-1 and SHA-256 text digests. It does not implement a password-storage format, generate a unique password salt, or expose a configurable password-hashing cost. Selecting SHA-256 in that form produces a deterministic checksum of the supplied UTF-8 text. That can demonstrate how hashing works, but the resulting hexadecimal string should not be copied into a new authentication database as though the site had created a complete password verifier. Use harmless demonstration text when exploring this distinction; a real account password is unnecessary for the example.

Use a deterministic digest to see the limitation

Hashing the text abc with SHA-256 always yields ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad. Running the same input again produces the same result. Anyone who guesses abc can compute that result too; they do not need to reverse the digest mathematically. A database of plain deterministic password digests therefore lets an attacker test guessed passwords by applying the same fast operation. Adding a longer printed representation or converting the digest to Base64 does not add secret information to the password and does not solve this guessing problem.

Store a salted password verifier

NIST's password-verifier guidance calls for a suitable salted password-hashing scheme with a cost factor that makes offline guessing more expensive. The salt is an additional input specific to the stored verifier, and it is stored with the information needed for verification. It is not a second password the user must remember. A maintained authentication library can produce and parse the encoded record, retaining the algorithm identifier, parameters and salt together. Use the library's documented API rather than manually concatenating fields and hoping that another system will interpret the resulting string in the same way.

Choose a scheme designed for the task

Argon2id is a password-hashing option described in RFC 9106 and recommended by OWASP for new applications where available. It has memory, iteration and parallelism parameters rather than merely an algorithm name. Those settings affect resource use and the cost of evaluating a guess. Select settings supported by the maintained library and the deployment environment, then measure their behavior under realistic authentication load. The three fast digest choices in the local demonstration tool do not become Argon2id by repeating the Calculate action. A distinct implementation of the password-hashing scheme is required.

Verify through the matching library function

A password-hashing library normally provides a verification operation that accepts the submitted password and the stored encoded record. The record supplies the original salt and parameters, allowing the verifier to check the candidate consistently. Generating a fresh salted record for the same password may produce a different string, so comparing two newly generated strings directly is the wrong test. In a development test using a fabricated password, confirm that the correct candidate verifies and an altered candidate fails. Also confirm that two independently created records can both verify the same fabricated password without requiring their serialized strings to match.

Plan for changes and legacy accounts

An authentication system needs a way to identify records that use older parameters or a legacy scheme. A successful login can provide an opportunity to create an updated record using the entered password and current policy, while accounts that cannot be upgraded may need a controlled reset process. Keep the migration logic explicit and tested. Simply hashing an old MD5 string once with SHA-256 does not turn it into the direct output of a modern password-hashing scheme. Retaining an algorithm identifier avoids guessing how an existing stored value was produced from its appearance alone.

Test the whole password path

Use a small development fixture with a fabricated password containing ordinary letters and a non-ASCII character. Check that registration and verification preserve the intended input consistently, that the full encoded record survives storage, and that a failed verification cannot leave a previous success visible in the application. Confirm that a parameter upgrade still accepts the valid password through the documented verification workflow. These are application tests, not features supplied by the local text checksum form. The form's useful role here is to demonstrate deterministic byte hashing so the additional responsibilities of actual password storage remain clear.

Use the Hash Generator

Open Hash Generator

Source and scope

NIST SP800-63B: password verifiers and offline-attack resistance

RFC9106: Argon2 password hashing and parameter choices

OWASP: password storage and upgrades