Cybersecurity

What is Hashing?

Hashing converts data of any size into a fixed-length fingerprint that can't be reversed, used for integrity checks and password storage.

Hashing is the process of turning input data of any size into a fixed-length string of characters, called a hash. It's a one-way function: you can't reverse a hash back to the original. Hashing is used to verify integrity and to store passwords safely.

How It Works:

  1. Feed any data (a word, file, or password) into a hash function
  2. Get back a fixed-length hash (a "fingerprint")
  3. The same input always produces the same hash
  4. Even a tiny change in input produces a completely different hash

Key Properties:

  • Deterministic: Same input → same output
  • Fixed length: Output size is constant
  • One-way: Can't reverse it
  • Collision-resistant: Hard to find two inputs with the same hash

Common Uses:

  • Password storage: Store hashes, not plaintext passwords
  • File integrity: Verify a download wasn't corrupted or tampered
  • Data structures: Hash tables for fast lookups
  • Digital signatures: Sign the hash of a document

FAQ

Why hash passwords instead of encrypting them?

If a database leaks, encrypted passwords could be decrypted with the key. Hashes can't be reversed. With salting and slow hash functions like bcrypt, they're much harder to crack.

What is a salt?

A salt is random data added to each password before hashing, so identical passwords produce different hashes. This defeats precomputed "rainbow table" attacks.

Promote your content

Reach over 400,000 developers and grow your brand.

Join our developer community

Hang out with over 4,500 developers and share your knowledge.