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 guesshashlib.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
- 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.
- Argon2 — A modern password hashing function that is deliberately slow and needs a lot of memory for every guess, which makes stolen password hashes very expensive to crack.
- salt — An extra value mixed into data before hashing so that otherwise identical inputs produce different hashes.
- password hashing — Storing a password as the output of a deliberately slow, salted hash function, so a stolen database does not reveal the passwords.
Taught in
- Cryptographic Hashing: SHA-256, SHA-3 & Passwords — Cybersecurity Fundamentals, GRC & Cryptography
- Authentication Versus Authorisation — Application Security & Threat Modeling for Engineers