OOmnistu

Blog / Engineering Playbooks

Engineering Playbooks

Password storage explained: hashing, salts and upgrade plans

Understand password hashing, salts and peppers, choose a supported approach and plan upgrades without confusing hashing with encryption.

OOmnistu
Reviewed 2026-11-16 · 4 min read

An application that verifies passwords should normally store password hashes, not readable passwords or reversible encrypted copies. A suitable password-hashing function makes each guess costly, while a unique salt prevents one precomputed result from being reused across many accounts. Neither measure makes a weak password impossible to guess.

The OWASP Password Storage Cheat Sheet is the source for the technical recommendations below. This is a design-review guide, not a recipe for implementing cryptography from scratch.

Hashing is different from encryption

Encryption is reversible with the right key. That is useful when an application genuinely needs to retrieve original data. A normal password-verification flow instead needs to check a submitted password without keeping a recoverable copy.

Hashing is one-way: the application does not decrypt the stored value to reveal the old password. That does not stop an attacker guessing a candidate password and testing whether it matches. The design must make repeated guesses expensive.

OWASP identifies unusual cases where a system needs an original password to authenticate to another service. It recommends an alternative architecture where possible. Do not use that exception as a reason to encrypt every user's sign-in password.

Why a fast hash is the wrong shortcut

Functions designed for fast general-purpose hashing, such as a plain SHA-256 hash, are not suitable password-storage schemes. Speed helps an attacker test many guesses.

Password-hashing functions have configurable costs. Some also deliberately require memory. Their purpose is to make guessing more expensive while keeping legitimate authentication practical.

The correct question is therefore not simply "do we hash passwords?" Ask which password-hashing algorithm, library and settings are used, and how the team reviews them over time.

Salts and peppers have different jobs

Item Purpose Storage implication
Salt Gives each password-hashing operation its own random input Usually managed by a correctly used password library; it need not be a separate secret
Pepper Adds a shared secret as an additional layer Must be protected separately from the password database
Work settings Control the hashing cost Need review and benchmarking on the actual verification system

A unique salt means equal passwords do not produce directly comparable stored hashes across users. It also prevents an attacker applying one precomputed lookup table to every account. It does not remove the need for an appropriate hashing algorithm.

A pepper adds an operational responsibility. If it is compromised, changing it can require affected users to reset their passwords. Do not introduce one without a plan for secret storage, availability and recovery. A pepper is an additional layer, not a substitute for proper password hashing.

Which algorithm should the team consider?

At this review, OWASP recommends Argon2id for new systems, scrypt when Argon2id is unavailable, and bcrypt for legacy situations where those alternatives are unavailable. It also discusses PBKDF2 for requirements involving approved implementations and compliance constraints.

That is not permission to pick an algorithm name and ignore configuration. Memory cost, iterations, implementation limits and deployment capacity matter. Bcrypt implementations, for example, have input-length limitations that the team must handle deliberately.

Use the current cheat sheet and the selected library's documentation when configuring a real system. This article intentionally does not freeze numerical settings into a copy-and-paste implementation recipe. Nor does choosing an algorithm by name establish compliance with a regulatory or certification requirement.

Benchmark legitimate use as well as attack cost

More expensive verification is not automatically better without limit. OWASP warns that excessive work factors can degrade authentication and create an opportunity for resource exhaustion through many attempts.

A useful project review records the selected settings, server environment, expected login load and observed verification behaviour. If the infrastructure changes, reassess rather than assuming old measurements still apply.

This review is distinct from testing password-reset flows, session handling or authorization. Good storage cannot compensate for an account-recovery route that gives an attacker control.

Make upgrades possible before they are urgent

Hashing settings and algorithms change over time. OWASP describes rehashing after a successful sign-in, when the submitted password is available for verification and upgrading. That leaves an important question: what happens to users who never return?

An upgrade plan should account for inactive users, support impact and any reset requirement. Merely wrapping an old weak hash in another algorithm has limitations; it is not equivalent to replacing it with a direct modern password hash.

Keep enough algorithm and configuration information in a standard supported representation to verify and upgrade existing records. Do not build a migration that silently makes legitimate users unable to sign in.

Evidence to request in a review

Ask for a design explanation and configuration evidence, not a database export containing password hashes. Useful questions include:

This guide does not certify an application as secure. It helps distinguish a real storage design from the vague assurance "passwords are encrypted."

By Omnistu. Reviewed against OWASP guidance on 16 November 2026. No application audit, password benchmark or compliance certification is claimed.

Sources

Previous
Passkeys for app teams: what the server side must get right