# Scrypt Generator

Derive a scrypt key from a password with a random or custom salt. Choose the cost exponent up to 15 (N up to 32768), the block size r up to 8, parallelism p up to 4 and a key length from 16 to 64 bytes. The tool follows RFC 7914 and returns the key, the salt used and the parameters in hex or Base64, ready to compare with Node.js crypto.scrypt, Python hashlib or libsodium. The password is not echoed.

## Frequently asked questions

### What is scrypt?

Scrypt is a memory-hard key derivation function by Colin Percival, standardized in RFC 7914. It derives a key from a password and a salt while forcing each attempt to use a large block of memory. It is used for password storage, disk encryption and some cryptocurrencies.

### What do N, r and p mean?

N is the CPU and memory cost and must be a power of two, r is the block size and p is the parallelization factor. Memory use is about 128 times N times r bytes, so N = 16384 with r = 8 needs 16 MiB. Here N goes up to 32768, r up to 8 and p up to 4.

### What are the default parameters?

The defaults are N = 16384 (cost exponent 14), r = 8, p = 1 and a 32-byte key, the interactive settings recommended in the scrypt paper. Increase N for stronger protection as far as your system allows.

### How is the salt chosen?

If the salt field is empty, the tool creates 16 random bytes and shows them in the result. If you enter a salt, its UTF-8 bytes are used, which lets you reproduce a key from another system. Never reuse one salt for different passwords.

### Can I reproduce the RFC 7914 test vectors?

Yes. The password pleaseletmein with the salt SodiumChloride, cost exponent 14, r = 8, p = 1 and a 64-byte key gives 7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887, the RFC's third vector.

### Why are the parameters capped?

Scrypt allocates real memory and runs on a shared server. Capping N at 32768, r at 8 and p at 4 keeps each derivation under about 32 MiB of memory and a second or two of work.

### How do I store a scrypt password hash?

Store the key, the salt and N, r and p together, because you need all of them to check a password later. Libraries such as Node.js crypto.scrypt leave the storage format to you, while others use their own string formats.

### Is my password included in the result?

No. The response contains the key, the salt and the parameters, but never the password. Nothing is logged or stored.

### Should I use scrypt or Argon2?

Both are memory hard and suitable for passwords. Argon2id is the newer recommendation and is easier to tune, while scrypt has wide support in standard libraries such as Node.js and Python.

### What do the hex and Base64 options change?

They change how the key and the salt are written in the result. The bytes are the same, so choose the form your code reads.

Your ad here?

[Email us](mailto:hi@dennn.is?subject=Advertising%20on%20OneClick%20Pro)

[Ad The agent-ready plugin suite for WordPress.](https://sleekwp.com/?ref=oneclickpro)
