Safety & security

Hashing

AI-assisted editorial review:

Hashing turns data of any size into a short, fixed-length value called a hash or digest. A cryptographic hash function is one-way: recovering an input from the hash should be computationally infeasible, although guessable inputs can still be discovered by testing candidates.[1] It is a basic computing tool behind password storage, file integrity checks and blockchains.[1][2][8] Different inputs can in principle share the same hash (a collision), but for a secure hash function finding one should be computationally infeasible.[11]

What does Hashing mean in simple terms?

Hashing the password "1234" with SHA-256 always gives the same 64-character value, starting with "03ac674216f3...". Because hashing is one-way, a service that stores only the hash does not keep the password itself, so a leaked database does not directly reveal it.[1] For passwords, however, a fast hash such as SHA-256 is not enough: attackers can guess common passwords and compare hashes very quickly. Security guidance therefore recommends slow, salted password hashing algorithms such as Argon2id, scrypt, bcrypt or PBKDF2.[1] SHA-256 itself is standardized by NIST and is used in Bitcoin's proof-of-work.[2][8]

How can Hashing be explained with an analogy?

A hash is like a fingerprint. The same person always leaves the same fingerprint, but you cannot rebuild the person from it.

Where is Hashing used?

Case 1

Password storage — Store hashes, not passwords (general practice)

OWASP's guidance says passwords should never be stored in plain text. Services should store a hash made with a slow algorithm, and add a unique random salt to each password so that identical passwords produce different hashes and precomputed lookup tables do not work.[1] At login, the service hashes the password the user types and compares it with the stored hash. Even this is not absolute: weak passwords can still be cracked by guessing, which is why slow algorithms and work factors matter.[1]
Result: OWASP recommends Argon2id first; scrypt if it is unavailable; bcrypt only for legacy systems; and PBKDF2 when FIPS-140 compliance is required.[1]

Case 2

Bitcoin — Proof-of-work with SHA-256

The Bitcoin white paper describes proof-of-work as searching for a value that, when hashed with SHA-256, produces a hash starting with a number of zero bits. Finding it takes a lot of work, but anyone can check it by computing a single hash.[8] Changing an old block would mean redoing that work for the block and every block after it.[8] In early October 2026, mempool.space estimated the network's hashrate at about 1,000 exahashes per second, roughly one billion terahashes per second.[9]
Result: Network hashrate of about 1 × 10^21 hashes per second (mempool.space estimate, October 2026).[9]

Case 3

SHA-1 collision — Why algorithms are retired

In February 2017, researchers from CWI Amsterdam and Google announced the first practical collision for SHA-1 and released two different PDF files with the same SHA-1 hash.[11] It took about 9.2 quintillion SHA-1 computations, yet it was still more than 100,000 times faster than brute force. The team urged moving to safer hashes such as SHA-256 and SHA-3.[11]
Result: SHA-1 is no longer considered safe for collision-resistant uses; OWASP also lists MD5 and SHA-1 as legacy hashes to upgrade from.[1][11]

Why hashing matters

Hashing is a basic IT tool for three reasons.

First, it is one-way. The original cannot be recovered from the hash, which makes hashing, rather than encryption, the standard approach for password verification.[1]

Second, it is fast to compute and easy to verify. General-purpose hashes are designed to be quick, and the Bitcoin network alone computes on the order of 10^21 hashes per second.[9] That speed is useful for checking data, but it is exactly why fast hashes are unsuitable for passwords.[1]

Third, a small change in the input produces a completely different result. "ai.percent.ac" and "AI.percent.ac" give entirely different SHA-256 hashes. NIST describes hash functions as a way to detect whether a message has changed since its digest was generated, which is why hashes are used to check file integrity.[2]

Try it today

  1. Ask your development team or vendor which algorithm stores user passwords, and check it against OWASP's recommendations (Argon2id, scrypt, bcrypt, PBKDF2).[1]
  2. Confirm that each password gets a unique salt and that the work factor has been reviewed recently.[1]
  3. When you download software, compare its SHA-256 checksum with the value the publisher lists.[2]
  4. Find any remaining MD5 or SHA-1 use in security-sensitive systems and plan an upgrade.[1][11]

Limits and direction

Hashing is not encryption and cannot be reversed to read the data back; if you need the original later, use encryption instead.[1] A hash only proves integrity if the reference value comes from a trusted place. Algorithms also age: SHA-1 was broken in practice in 2017, and password hashing has moved from bcrypt (1999) toward memory-hard functions such as Argon2.[7][11][4] Argon2 won the Password Hashing Competition in 2015 and was published as RFC 9106 in 2021.[5][4] bcrypt's key idea, a cost that can be raised as hardware gets faster, is still the core of good password storage.[6][7]

How has Hashing evolved?

2002-08-01
SHA-256 standardized
NIST published FIPS 180-2, which specified SHA-256 alongside SHA-1, SHA-384 and SHA-512. The current version is FIPS 180-4 (2015).[3][2]
2009-01-03
Bitcoin genesis block
The first Bitcoin block was mined. Bitcoin uses SHA-256-based proof-of-work, as described in its white paper.[10][8]
2021-09
Argon2 published as RFC 9106
Argon2, the 2015 Password Hashing Competition winner, was published as an informational RFC. OWASP now lists Argon2id as its first choice for password storage.[5][4][1]

Which concepts are related to Hashing?

  • Related security method
    EncryptionEncryption is two-way and can be decrypted; hashing is one-way.[1]

Which sources explain Hashing?

  1. OWASP Cheat Sheet Series — Password Storage Cheat Sheet (accessed 2026-10-13) — https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
  2. NIST — FIPS 180-4, Secure Hash Standard (2015-08-04) — https://csrc.nist.gov/pubs/fips/180-4/upd1/final
  3. NIST — FIPS 180-2, Secure Hash Standard (2002-08-01; change notice 2004-02-25; withdrawn 2008) — https://csrc.nist.gov/pubs/fips/180-2/upd1/final
  4. RFC Editor — RFC 9106: Argon2 Memory-Hard Function for Password Hashing and Proof-of-Work Applications (2021-09) — https://www.rfc-editor.org/rfc/rfc9106
  5. Password Hashing Competition — Our recommendation for hashing passwords: Argon2 — https://www.password-hashing.net/
  6. Openwall — bcrypt password hashing (crypt_blowfish) — https://www.openwall.com/crypt/
  7. USENIX — Provos and Mazières, A Future-Adaptable Password Scheme (USENIX 1999) — https://www.usenix.org/legacy/events/usenix99/provos.html
  8. Satoshi Nakamoto — Bitcoin: A Peer-to-Peer Electronic Cash System (2008) — https://bitcoin.org/bitcoin.pdf
  9. mempool.space — Bitcoin network hashrate API, 1-month data (accessed 2026-10-13) — https://mempool.space/api/v1/mining/hashrate/1m
  10. mempool.space — Bitcoin block 0 (genesis block) data — https://mempool.space/api/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
  11. Google Online Security Blog — Announcing the first SHA1 collision (2017-02-23) — https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html