export declare const scryptAsync: (arg1: string | Buffer | DataView, arg2: string | Buffer | DataView, arg3: number) => Promise>; /** * Legacy (v1) derivation: `scrypt(input, AUTH_SALT, hashRounds)`. Kept only for * verifying pre-existing v1 password hashes (see {@link verifyPassword}). Do not * use for new hashes — {@link hashPassword} is the current scheme. */ export declare const scryptAsyncWithSalt: (stringToHash: string) => Promise>; export declare const scryptAsyncWithSaltAsString: (stringToHash: string) => Promise; /** Hash a password with the current (v2) scheme: per-user salt + pepper. */ export declare const hashPassword: (password: string) => Promise; /** * Compare two secret strings (tokens, API keys, webhook signatures) in constant * time. Hashing first gives equal-length inputs, so the length isn't leaked either. */ export declare const timingSafeEqualStrings: (a: string, b: string) => boolean; /** * Verify a password against a stored hash of any scheme version. * @returns `valid` — does the password match; `needsRehash` — should the caller * re-hash with the current scheme (legacy hash, or cost below current target). */ export declare const verifyPassword: (password: string, stored: string) => Promise<{ valid: boolean; needsRehash: boolean; }>; /** * Burn one password-verify's worth of scrypt work, then discard the result. * Call this on the "no such user / no password" branch of a login so that a * non-existent account is not distinguishable from a wrong password by response * latency — i.e. it closes the user-enumeration timing oracle. */ export declare const burnPasswordVerify: (password: string) => Promise; /** * Hash a short, low-entropy secret such as a 6-digit login code (base64url). * Keyed with `AUTH_SALT`: a leaked hash cannot be brute-forced without it, and * rotating `AUTH_SALT` invalidates every stored hash. `purpose` names the * feature; a hash made for one purpose never verifies under another. * For long random tokens use `hashToken`; for passwords use `hashPassword`. */ export declare const hashSecret: (value: string, { purpose }: { purpose: string; }) => string; /** Constant-time check of `value` against a {@link hashSecret} result. */ export declare const verifySecret: (value: string, stored: string, { purpose }: { purpose: string; }) => boolean;