The scrypt password-based key derivation function with sync and cancellable async.
Overall
score
98%
Build a password key derivation utility that validates input parameters and derives cryptographic keys from passwords using the scrypt algorithm.
@generates
/**
* Derives a cryptographic key from a password using scrypt algorithm.
* Validates all input parameters before derivation.
*
* @param {ArrayLike<number>|Buffer} password - The password to derive a key from
* @param {ArrayLike<number>|Buffer} salt - The cryptographic salt
* @param {number} N - CPU/memory cost parameter (must be a power of 2)
* @param {number} r - Block size parameter (must be a positive integer)
* @param {number} p - Parallelization parameter (must be a positive integer)
* @param {number} dkLen - Desired key length in bytes (must be positive)
* @returns {Promise<Uint8Array>} A promise that resolves to the derived key
* @throws {Error} Throws descriptive errors for invalid parameters
*/
async function deriveKey(password, salt, N, r, p, dkLen) {
// IMPLEMENTATION HERE
}
module.exports = { deriveKey };Provides scrypt password-based key derivation functionality with input validation.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-scrypt-jsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10