crypto_scrypt
Derive a memory-hard key using scrypt to resist GPU and ASIC cracking. Tune N, r, p parameters for desired strength.
Instructions
Scrypt Password Hash Generator. Generate a memory-hard scrypt password hash and key derivation from a password and tunable cost parameters (N, r, p, key length). scrypt deliberately consumes large amounts of RAM to resist GPU/ASIC cracking; use it when you want memory-hardness. Prefer crypto_argon2 or crypto_bcrypt for general password storage; use crypto_pbkdf2 when only iteration count matters; use crypto_scrypt_verify to check a password against an existing scrypt hash. A random 16-byte salt is generated when salt is omitted, so output is non-deterministic between calls. Runs locally on the input you provide: read-only, non-destructive, contacts no external service, and is rate-limited. Returns the derived key (hex and base64), an encoded hash string, the salt, the parameters used, and a strength analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| password | Yes | The plaintext password to derive the scrypt hash from. Required and must be non-empty. | |
| N | No | CPU/memory cost factor; must be a power of 2 between 2 and 1048576. Higher values increase both time and memory cost (32768 or above recommended). | |
| r | No | Block-size factor (1 to 256); scales memory usage. 8 is the standard value. | |
| p | No | Parallelization factor (1 to 256); number of independent mixing operations. | |
| length | No | Derived key length in bytes (16 to 128). | |
| salt | No | Optional salt as a hexadecimal string (even number of hex digits). When omitted or empty, a random 16-byte salt is generated, making output non-deterministic. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | No | Derived key encoded as a hexadecimal string. | |
| base64Hash | No | Derived key encoded as base64. | |
| formattedHash | No | Encoded hash string in the format $scrypt$N=<N>,r=<r>,p=<p>$<saltHex>$<base64DerivedKey>, accepted by crypto_scrypt_verify. | |
| algorithm | No | Algorithm identifier; always scrypt. | |
| parameters | No | The cost parameters used for the derivation. | |
| salt | No | Salt used for the derivation, in hexadecimal (random when none supplied). | |
| saltLength | No | Length of the hex salt string. | |
| security | No | Strength analysis of the chosen parameters. |