The scrypt password-based key derivation function with sync and cancellable async.
Overall
score
98%
Build a password hashing utility that derives cryptographic keys from user passwords while providing real-time progress feedback. The utility should handle long-running key derivation operations without blocking the event loop, allowing other application logic to continue processing.
@generates
/**
* Derives a cryptographic key from a password with progress tracking.
*
* @param {string} password - The password to derive the key from
* @param {Buffer|Uint8Array} salt - Cryptographic salt (recommended: 16+ bytes)
* @param {number} N - CPU/memory cost parameter (must be power of 2)
* @param {number} r - Block size parameter
* @param {number} p - Parallelization parameter
* @param {number} dkLen - Desired length of derived key in bytes
* @param {Function} progressCallback - Callback function that receives progress (0 to 1)
* @returns {Promise<Uint8Array>} The derived key
*/
async function deriveKeyWithProgress(password, salt, N, r, p, dkLen, progressCallback) {
// IMPLEMENTATION HERE
}
module.exports = {
deriveKeyWithProgress
};Provides password-based key derivation with non-blocking asynchronous execution.
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