crypto_scrypt_verify
Verify a plaintext password against an existing scrypt hash by recomputing the derivation from the hash's N, r, p, and salt parameters. Returns match status, parsed parameters, and strength analysis.
Instructions
Scrypt Hash Verifier. Check whether a plaintext password matches an existing scrypt hash, recomputing the derivation from the N, r, p, and salt encoded in the hash string. Use this to verify a candidate password; use crypto_scrypt instead to generate a new hash. Runs locally on the input you provide: read-only, non-destructive, contacts no external service, and is rate-limited. Returns whether the password matched, the parameters parsed from the hash, and a strength analysis of those parameters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| password | Yes | The plaintext password to test against the hash. | |
| hash | Yes | The encoded scrypt hash to verify against, in the format produced by crypto_scrypt: $scrypt$N=<N>,r=<r>,p=<p>$<saltHex>$<base64DerivedKey>. The N, r, p, and salt are read from this string to recompute the derivation and compare it against the supplied password. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| verified | No | True when the password matches the supplied hash. | |
| info | No | Parameters parsed from the hash; null when the hash format is invalid. | |
| security | No | Strength analysis of the parsed parameters; null on error. | |
| error | No | Error message when verification fails (e.g. invalid hash format); null on success. |