Graph
Hash Function

#️⃣Hash Function

NEW

A function that maps arbitrary-length inputs to fixed-length digests, designed for collision and preimage resistance in security applications.

DESCRIPTION

Hash functions compress data into short digests used for integrity checks, digital signatures, and data structures. Cryptographic hash functions must resist collisions, preimages, and second preimages. Designs include Merkle–Damgård (e.g., SHA-2) and sponge (SHA-3). Security-sensitive uses require modern hashes and proper salting or slow KDFs for passwords. Legacy hashes like MD5 and SHA-1 are broken for collision resistance and should be avoided.

ALTERNATIVE DEFINITIONS

FIPS 180-4 (Secure Hash Standard)

A cryptographic hash function maps a bit string of arbitrary length to a bit string of fixed length and is designed to be computationally infeasible to find collisions.

Defines both mapping and security property of collision resistance.

Source

IETF RFC 4949 (Internet Security Glossary)

Hash function: A (mathematical) function that maps a string of arbitrary length to a fixed-length string; a cryptographic hash function is one for which it is computationally infeasible to find collisions.

Distinguishes general and cryptographic hash functions.

Source

Wikipedia

A cryptographic hash function is a hash function that is suitable for use in cryptography, with properties such as preimage resistance and collision resistance.

Highlights standard resistance properties beyond collisions.

Source

Cryptographic Hash Function Collision Resistance Preimage Resistance MD5 SHA-256 SHA-3 HMAC Digital Signature Merkle–Damgård

COMPETING TERMS

Checksum

RELATIONS

KNOWLEDGE AREAS

Data Security Software Engineering Data Management

TARGET AUDIENCE

Software Developer Security Architect Cybersecurity Engineer Data Engineer IT Manager

EXTERNAL SOURCES

TOP QUESTIONS

What makes a hash function cryptographic?

It must provide collision, preimage, and second-preimage resistance, making certain finding tasks computationally infeasible.

Category: Understanding

Can I use MD5 for integrity checks?

No for security-sensitive contexts. MD5 collisions are practical; use SHA-256 or SHA-3.

Category: BestPractices

Do hash functions encrypt data?

No. Hashing is one-way compression, not reversible encryption. It’s for integrity, not confidentiality.

Category: Misunderstanding

Why are salts important in hashing passwords?

Salts prevent precomputed attacks and ensure identical passwords produce different hashes, defeating rainbow tables.

Category: Understanding

What is an example of a modern hash function?

SHA-256 (SHA-2 family) and SHA-3 are widely used and standardized.

Category: Example

Are faster hashes always better?

Not for passwords. Use slow, memory-hard KDFs (e.g., Argon2) to resist brute force.

Category: BestPractices

How are hashes used in digital signatures?

Messages are hashed first; the digest is signed, improving efficiency and standardizing input size.

Category: Example

What is collision resistance?

It’s the difficulty of finding two different inputs that produce the same hash output.

Category: Understanding

Do checksums and hashes serve the same purpose?

Checksums detect random errors; cryptographic hashes protect against adversarial tampering. Use hashes for security.

Category: Misunderstanding