scrypt Playground

Compute scrypt with custom N, r, p, salt and key length, see the memory needed, and get raw hex or a $scrypt$ string. RFC 7914 test vectors verified.

Memory needed: 128 × N × r = 128 MiB

scrypt (RFC 7914) is memory-hard. OWASP minimum: N=2^17, r=8, p=1 (128 MiB). Computed with hash-wasm in your browser; large N values need a lot of memory.

Verify a password against a hash

Runs entirely in your browser. Your data is never uploaded.

What is Scrypt Playground?

Run the memory-hard scrypt key derivation function (RFC 7914) with your own cost parameters and salt. The tool shows how much memory the settings need, the raw derived key and an encoded $scrypt$ string you can verify later.

How to use Scrypt Playground

  1. Enter the Password.
  2. Choose CPU/memory cost (N) as a power of two, Block size (r), Parallelism (p) and Key length.
  3. Enter a Salt and its encoding, or leave it empty for a random salt.
  4. Click Hash and copy the result; verify it in the panel below.

Example

Input
Password password, salt NaCl, N=1024, r=8, p=16, 64 bytes
Output
fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b3731622eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640

RFC 7914 section 12, test vector 2.

When to use Scrypt Playground

Use it to tune scrypt parameters, check RFC 7914 vectors or debug hashes from Node.js crypto.scrypt, Python hashlib.scrypt or passlib. Large N values need hundreds of MiB and may fail on mobile devices.

How Scrypt Playground works

scrypt runs PBKDF2-HMAC-SHA-256 once to expand the input, then the ROMix function fills 128 × N × r bytes of memory with Salsa20/8-based BlockMix outputs and reads them back in a data-dependent order, p times, before a final PBKDF2 step. The encoded form is $scrypt$ln=<log2 N>,r=<r>,p=<p>$<salt>$<hash> in Base64. Computation uses hash-wasm (WebAssembly).

Common Use Cases

  • Choosing N so hashing takes about 100 ms
  • Reproducing RFC 7914 test vectors
  • Debugging hashes created with Node's crypto.scrypt
  • Showing how memory cost grows with N and r

FAQs

What parameters does OWASP recommend?

At least N=2^17, r=8, p=1, which uses 128 MiB, or trade-offs such as N=2^16, r=8, p=2.

How much memory does scrypt use?

128 × N × r bytes, shown under the parameters. N=2^17 and r=8 need 128 MiB.

Is scrypt better than bcrypt?

It is memory-hard, which makes GPU and ASIC attacks more expensive. Argon2id is the current first choice, scrypt a good second.

Explore more categories