scrypt

A memory-hard password hashing function that is slow and needs lots of memory, so guessing passwords in bulk is expensive.

In more detail

Its cost parameters are n (work and memory), r (block size) and p (parallelism). Many languages provide it, for example Python as hashlib.scrypt, which takes the password bytes and a random salt.

Examples

hashlib.scrypt(password.encode(), salt=salt, n=2**14, r=8, p=1)
128 * r * n with r=8 and n=2**14 is 16 MiB of memory per guess
hashlib.scrypt(password.encode(), salt=salt, n=16384, r=8, p=1)
Its cost parameters are n (work and memory), r (block size) and p (parallelism); the course uses n=16384, r=8, p=1.

Related terms

Taught in

References