Password hash family

scrypt

Colin Percival's memory-hard key derivation function, standardised in RFC 7914

standard 1 variant RFC 7914

Overview

scrypt is a password-based key derivation function designed by Colin Percival in 2009 to make large-scale hardware attacks costly by requiring substantial memory. It is specified in RFC 7914 and is widely used in password storage, disk encryption and cryptocurrencies.

scrypt first stretches the password and salt with PBKDF2-HMAC-SHA256 into p blocks. Each block is processed by ROMix: a sequence of N pseudo-random blocks is generated with the BlockMix function built on Salsa20/8 and stored in memory, then N data-dependent lookups into that sequence are mixed back into the state. The outputs are recombined with PBKDF2 to produce the key. The parameters N (cost), r (block size) and p (parallelism) set memory and time.

Memory use is roughly 128·N·r bytes. Litecoin and several other cryptocurrencies use scrypt with very small parameters as a proof-of-work function, which should not be confused with password-hashing settings. Typical interactive settings start around N = 2^15 to 2^17 with r = 8 and p = 1, adjusted to the time and memory budget of the server. The memory cost is what makes custom cracking hardware expensive.

History

2009–2016
  1. scrypt published by Colin Percival

  2. Specified in RFC 7914

Security notes

scrypt is secure when tuned with sufficiently large N. Its data-dependent memory access can leak timing information through cache side channels, which Argon2id avoids. Parameters that were adequate in 2009 are too low today.

Typical uses

Password storagePassphrase-based encryption keysDisk and wallet encryption

Variants in NextSSL

1
AlgorithmTierSizes (bytes)StandardsAPI
scrypt
scrypt
standard out 16–1024 · salt 0–64 RFC 7914 safe

Frequently asked questions

Which scrypt variants does NextSSL include?

NextSSL registers 1 scrypt variant: scrypt.