Course contentsShow
← Security
Lesson 689 of 3,05215. Web Security - Authentication and SessionsFree lesson

scrypt: Memory-Hard Password Hashing

Learn how scrypt uses memory requirements to resist GPU and ASIC-based cracking.

scrypt: Memory-Hard Password Hashing

You'll learn how scrypt makes password cracking expensive by requiring massive amounts of memory, not just computational time.

The Problem bcrypt Doesn't Fully Solve

You already know bcrypt slows down attackers by requiring computational work. However, specialized hardware like GPUs (graphics cards) and ASICs (custom chips) can perform many bcrypt operations in parallel because each attempt only needs a tiny amount of memory. An attacker with the right hardware can still test millions of passwords simultaneously.

How scrypt Changes the Game

scrypt is a password hashing algorithm designed to be memory-hard. While it also takes time to compute (like bcrypt), scrypt requires a configurable, large amount of RAM for each hash operation.

Think of it like this: bcrypt is a complex math problem that takes time but fits on a napkin. scrypt is a problem that requires spreading papers across an entire warehouse floor—you need the physical space (memory) to solve it.

Why Memory Matters

Modern attack hardware (GPUs, ASICs) has thousands of processing cores but shares limited memory among them. When each password hash attempt requires, say, 64MB or 128MB of RAM, attackers can only run a handful of attempts simultaneously instead of millions. The hardware sits idle waiting for memory access, making parallel cracking economically impractical.

The Cost Tradeoff

Legitimate authentication (one user logging in) uses that memory once—no big deal. But an attacker trying billions of password combinations needs that memory multiplied by every parallel attempt, quickly becoming prohibitively expensive.

Key Takeaway:
scrypt defeats GPU and ASIC-based cracking by requiring substantial memory per hash, making parallel attacks economically unfeasible while remaining practical for normal authentication.