The scrypt password-based key derivation function with sync and cancellable async.
Overall
score
98%
Build a utility that efficiently derives cryptographic keys from multiple passwords using memory-efficient array operations.
Your utility should process a list of passwords and derive keys for each one, handling the array-based inputs and outputs efficiently to minimize memory overhead.
Implement a function deriveKeys that:
Each derived key should be 32 bytes long and use the following scrypt parameters:
["password1", "password2"] and salt "salt123", the function returns an array of two 64-character hexadecimal strings (32 bytes = 64 hex chars). @test[] and any salt, the function returns an empty array. @test["test"] and salt "sea", the derived key has exactly 64 hexadecimal characters. @test@generates
/**
* Derives cryptographic keys from multiple passwords using scrypt.
* Uses memory-efficient array operations for conversion and processing.
*
* @param {string[]} passwords - Array of password strings to derive keys from
* @param {string} salt - Salt string used for all derivations
* @returns {Promise<string[]>} Promise resolving to array of derived keys in hexadecimal format
*/
async function deriveKeys(passwords, salt) {
// Implementation
}
module.exports = { deriveKeys };Provides password-based key derivation functionality.
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