Scrypt hash generator with custom N, r and p
This scrypt hash generator runs the scrypt key derivation function on a password and returns the derived bytes in several encodings. Use it to check test vectors, debug a mismatch between two libraries, or derive a key with known parameters before writing code.
What is scrypt?
scrypt was designed by Colin Percival in 2009 and is standardized in RFC 7914. Like Argon2, it is memory-hard: computing one hash requires a large buffer of RAM, which makes massive parallel guessing on GPUs or ASICs expensive. It is used for password storage, disk and wallet encryption keys, and some proof-of-work schemes.
Example
Deriving 32 bytes from correct horse battery staple with N=16384, r=8, p=1 and the text salt NaCl gives:
Hex: 93d06c7dff9984858ff25694e9f7004c9e3ce466bfd263e24f7c1101a2d193ea
Base64: k9Bsff+ZhIWP8laU6fcATJ485Ga/0mPiT3wRAaLRk+o=
Salt: 4e61436c (hex)
# Common encoded forms
$scrypt$ln=14,r=8,p=1$TmFDbA$k9Bsff+ZhIWP8laU6fcATJ485Ga/0mPiT3wRAaLRk+o
scrypt:16384:8:1$4e61436c$93d06c7dff9984858ff25694e9f7004c9e3ce466bfd263e24f7c1101a2d193ea
The $scrypt$ln=… line is the modular crypt format used by Python's passlib, where ln is log2 of N. The second line is a compact colon-separated form with hex salt and hash. The status bar also shows approximate memory use: 128 × r × N bytes, or about 16 MiB here.
Parameters explained
- Cost N – the CPU and memory cost. It must be a power of two, such as 16384, 32768 or 65536. Doubling N doubles both time and RAM.
- Block size r – scales the memory block size. 8 is the standard value almost everyone uses.
- Parallelism p – runs independent mixes, multiplying CPU time without increasing peak memory.
- Output length – 32 bytes suits an AES-256 key; 64 bytes is the default here.
The tool refuses settings needing more than 1 GiB so your browser tab stays responsive. If you pass a value that is not a power of two, you get a clear error instead of a silently wrong key.
scrypt vs Argon2 and PBKDF2
scrypt remains a solid choice and is built into Node.js and OpenSSL. For new password storage, the Argon2 hash generator shows the more modern alternative with separate memory and time knobs. If you need FIPS-approved derivation, use the PBKDF2 generator instead. Found an unfamiliar hash string? The hash identifier recognizes $scrypt$ prefixes.
Privacy
Derivation runs in your browser with WebAssembly, and random salts come from crypto.getRandomValues. Nothing you enter is uploaded.