AttackVector.tech

What is Password Hashing?

Password hashing transforms passwords into secure, irreversible hashes using algorithms like bcrypt to protect data effectively.

Explain Like I'm 5

Think of your password like a secret recipe for your favorite dessert. You don't want anyone to know the exact recipe, so you mix it up into a jumbled code that only you can recognize. This jumbled code is a password hash.

Before jumbling, you add a special secret ingredient called 'salt'—a unique, random value. This ensures even if someone else has a similar recipe, theirs will look different when jumbled.

This is important because if a hacker gets into a database, they only see the jumbled codes and can't easily figure out the original passwords. It's like seeing a scrambled recipe and having no clue what the actual dessert is.

Technical Definition

Definition

Password hashing transforms a plain text password into a fixed-length string of characters that looks random. This uses a one-way cryptographic hash function, making it nearly impossible to recover the original password.

How It Works

  1. 1A user creates a password.
  2. 2A salt, a random value, is generated for that password.
  3. 3The password and salt are combined and processed by a hash function (e.g., bcrypt, scrypt, Argon2, PBKDF2).
  4. 4The function outputs a hash, stored in the database.
  5. 5To verify a password, the process is repeated, and the new hash is compared to the stored hash.

Key Characteristics

  • One-way Function: Hash functions are irreversible.
  • Unique Salt: Ensures different hashes for identical passwords.
  • Adaptive: Modern algorithms (bcrypt, Argon2) adjust to computational power, maintaining security.

Comparison

FeatureMD5/SHA1bcrypt/scrypt/Argon2
Security LevelLowHigh
Collision ResistanceWeakStrong
Salting RequirementOptionalRequired

Real-World Example

In 2012, LinkedIn experienced a breach where unsalted SHA1 password hashes were leaked, exposing millions of user credentials to rainbow table attacks (CVE-2012-2313).

Detection & Prevention

  • Use Strong Hash Functions: Utilize algorithms like bcrypt, scrypt, or Argon2.
  • Add Salt and Pepper: Always use a unique salt and consider additional 'pepper' (a secret value).
  • Regularly Update and Audit: Use tools such as OWASP ZAP or Burp Suite for security audits.

Common Misconceptions

  • All Hash Functions Are Secure: Older functions like MD5 and SHA1 are vulnerable and should not be used.
  • No Need for Salting: Salting is crucial to prevent attacks like rainbow tables.
  • Hash Once, Secure Forever: Security requires ongoing updates and monitoring.

Keywords

what is Password HashingPassword Hashing explainedPassword Hashing detectionbcrypt vs MD5secure password storagesalt and pepper in hashing

Ready to scan your site?

AttackVector uses AI agents to find vulnerabilities before attackers do. Start a free scan now.

Start Free Scan