PLAIN QUANTUM
Search

What is a hash function?

  • Level: Beginner
  • 2 min read
  • Quick answer
The short answer

A hash function turns any amount of data, a word or an entire archive, into a short fingerprint of fixed length. The same input always gives the same fingerprint, a one-character change gives a completely different one, and there's no practical way to work backwards from the fingerprint to the data. The most widely used today is SHA-256, from the SHA-2 family.

What a good hash guarantees

  • One-way. Given a fingerprint, finding any input that produces it is computationally infeasible: no known method could do it with a realistic amount of computing.
  • Collision-resistant. There are far more possible inputs than fingerprints, so different inputs with the same fingerprint must exist. Finding any two of them is computationally infeasible.
  • Sensitive. Any change to the input, however small, changes the fingerprint completely.
$100 $900 118 of 256 changed $100 $900 118 of 256 changed
The real SHA-256 fingerprints of "Pay Asha $100" and "Pay Asha $900", shown as their 256 bits (a filled square is a 1). Changing one character changed 118 of the 256 bits, spread across the whole fingerprint. About half is what a good hash should give, so even the smallest alteration shows.

Where hashes are used

  • Inside signatures. A digital signature is made over the message's hash, so it covers every character.
  • Integrity checks. Comparing fingerprints shows whether a file, log or record has been altered.
  • Passwords. Well-run systems store a slow, salted hash of each password rather than the password itself.
  • Post-quantum signatures. SLH-DSA builds signatures entirely from hash functions, which is why it's the conservative backup.

What quantum computers do to hashes

Very little, in practice. Grover's algorithm could speed up the search for an input matching a given fingerprint, but only by a square root, and real quantum hardware would add large overheads on top. Finding collisions gains even less in practice. Current guidance treats SHA-256 and larger as remaining secure, and the US national security suite uses SHA-384 or larger for extra margin. Hashes need a size check, not a replacement.

Common confusions

  • "Hashing is encryption." No. There's no key and no way to decrypt. A hash only fingerprints data.
  • "MD5 and SHA-1 were broken by quantum computers." No. They were weakened by ordinary research years ago and shouldn't be used, but that's unrelated to quantum computing.
  • "Quantum computers make hashes useless." No. They weaken them only modestly; modern sizes keep a comfortable margin.

Where this comes up

Sources and further reading

Tags show the kind of source (how sources are chosen and checked). Checked against these sources on 20 October 2026.

  1. StandardFIPS 180-4: Secure Hash Standard (SHS)NIST, 2015
  2. StandardFIPS 202: SHA-3 StandardNIST, 2015
  3. StandardFIPS 205: Stateless Hash-Based Digital Signature Standard (SLH-DSA)NIST, 2024
  4. Government guidanceNSA releases future quantum-resistant algorithm requirements for national security systems (CNSA 2.0)US National Security Agency, 2022

Written by Muhammad Atif · Reviewed 20 October 2026 · Report a correction