0Pricing
Cryptology Academy · Lesson

Why Plain SHA-256 Fails for Passwords

Understand rainbow tables, brute-force speed, and salt.

Why Plain SHA-256 Fails for Passwords is a free Cryptology Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Welcome

Storing passwords securely is one of the most misunderstood topics in security. In this lesson we understand why fast hashes like SHA-256 are catastrophically wrong for passwords.

What Happens When DBs Leak

Database breaches happen constantly. In 2024, RockYou2024 leaked 10 billion passwords. If your users' passwords are stored recoverable, attackers will recover them.

Naive SHA-256 Storage

Bad pattern: hashed = sha256(password) store(username, hashed) Problems: (1) sha256 is blazing fast, (2) same password → same hash (no salt), (3) rainbow tables exist for common passwords.

Rainbow Table Attack

A rainbow table is a precomputed mapping of hash→password for millions of common passwords. SHA-256('password') is always the same hash. Table lookup: instant decryption of most passwords.

The Role of Salt

Salt = random bytes prepended to password before hashing. hash = sha256(salt + password) Each user gets a unique salt. Rainbow tables become useless — attacker must brute-force each user individually.

But Salt Alone Isn't Enough

A modern GPU computes 10 BILLION SHA-256 hashes per second. Even with unique salts, an attacker with leaked hashes can brute-force 8-character passwords in minutes.

The Speed Problem

SHA-256 was designed to be fast — for file integrity, TLS, etc. Speed is an enemy for password hashing. We need intentionally slow algorithms that resist brute-force.

Key Stretching

Key stretching iterates the hash function thousands of times: for i in range(100000): h = sha256(h). This slows down both attacker and defender — but hardware advantage still favors the attacker.

Memory-Hard Functions

Modern password hashers require large amounts of RAM, not just CPU cycles. GPUs have limited per-core RAM compared to CPUs. Argon2's memory-hardness neutralizes GPU/ASIC advantages.

Common Mistakes

Don'ts: - sha256(password) - sha256(salt + password) without iteration - md5(password) (or any MD5) - Encrypting passwords (can be decrypted) - sha256(sha256(password)) (still fast)

What to Use Instead

Use: bcrypt (most widely deployed), Argon2id (recommended by OWASP, memory-hard), PBKDF2-SHA256 (FIPS-compliant, acceptable). All three are intentionally slow and salted by design.

Quick Check

Why is SHA-256 unsuitable for password hashing even when using a salt?

Recap

SHA-256 is wrong for passwords. Next we study bcrypt — the algorithm that intentionally makes hashing slow and hardware-resistant.

Frequently asked questions

Is the “Why Plain SHA-256 Fails for Passwords” lesson free?

Yes — the full text of “Why Plain SHA-256 Fails for Passwords” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.

What will I learn in “Why Plain SHA-256 Fails for Passwords”?

Understand rainbow tables, brute-force speed, and salt. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Why Plain SHA-256 Fails for Passwords” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Plain SHA-256 Fails for Passwords
  2. bcrypt: Algorithm & Cost Factor
  3. Argon2: Memory-Hard Password Hashing
  4. PBKDF2 & Choosing the Right Algorithm
← Back to Cryptology Academy