Skip to content

Questions about Cryptographic hash function

Short answers, pulled from the story.

What is a cryptographic hash function used for?

A cryptographic hash function turns any message into a fixed-length hash value used in digital signatures, message authentication codes, and other authentication methods. It also supports hash tables, fingerprinting, duplicate detection, and checksums for catching accidental data corruption.

What are the three security properties a cryptographic hash function must have?

A cryptographic hash function must offer pre-image resistance, second pre-image resistance, and collision resistance. Pre-image resistance means a hash value should not reveal any message that produces it; second pre-image resistance blocks finding a different match for a known input; and collision resistance blocks finding any two messages that share a hash.

When was the MD5 cryptographic hash function designed and why is it no longer safe?

Ronald Rivest designed MD5 in 1991 to replace the earlier MD4 function, and it was specified in 1992 as RFC 1321. Collisions against MD5 can now be calculated within seconds, and a successful practical attack broke it in 2008, making it unsuitable for most uses that need a cryptographic hash.

Why is SHA-1 considered broken as a cryptographic hash function?

SHA-1 is considered broken because collisions against the full algorithm can now be produced using the shattered attack. Google announced an actual SHA-1 collision in February 2017, following earlier theoretical attacks reported in February 2005 and August 2005.

How does a cryptographic hash function protect stored passwords?

Systems store only the hash digest of a password rather than the password itself, so a stolen database exposes hash values, not plain passwords. Because standard hashes like the SHA series compute quickly, password systems add a random salt and use key stretching functions such as PBKDF2, scrypt, or Argon2 to slow brute-force guessing.

How does proof-of-work use a cryptographic hash function, as in Bitcoin and Hashcash?

Proof-of-work systems require a sender to find a message whose hash value starts with a set number of zero bits, work that grows exponentially harder as more zero bits are required. Bitcoin mining uses this to unlock a mining reward, while Hashcash uses it as a good-will token attached to an email, and in Hashcash a 160-bit SHA-1 header hash must have its first 20 bits at zero.