memory-hard function

A function that cannot be computed quickly without using a large amount of memory, which makes mass guessing on specialised hardware expensive.

In more detail

Password crackers rely on graphics cards and custom chips that run thousands of simple calculations side by side but have little fast memory for each one. A memory-hard function forces every single guess to fill and reread a big block of memory, so the attacker's advantage shrinks to roughly what a normal computer can do. Argon2 and scrypt are memory-hard; bcrypt and PBKDF2 are not.

Example

scrypt with n=2**14 and r=8 needs 16 MiB for every password guess

Related terms

Taught in

References