The scrypt password-based key derivation function with sync and cancellable async.
Overall
score
98%
Build a password key derivation service that generates secure cryptographic keys from user passwords. The service should provide different security levels based on configurable parameters.
Implement three security level presets:
Implement a function that:
The function should use the following parameter configurations for each security level:
Provides password-based key derivation functionality.
Input:
[112, 97, 115, 115, 119, 111, 114, 100] (UTF-8 bytes for "password")[115, 97, 108, 116] (UTF-8 bytes for "salt")Expected Output: The function should successfully return a 32-byte key derived using N=1024, r=8, p=1.
File: derive.test.js
Input:
[116, 101, 115, 116, 49, 50, 51] (UTF-8 bytes for "test123")[115, 97, 108, 116, 121] (UTF-8 bytes for "salty")Expected Output: The function should successfully return a 64-byte key derived using N=16384, r=8, p=1.
File: derive.test.js
Input:
[115, 101, 99, 117, 114, 101] (UTF-8 bytes for "secure")[114, 97, 110, 100, 111, 109, 115, 97, 108, 116] (UTF-8 bytes for "randomsalt")Expected Output: The function should successfully return a 32-byte key derived using N=32768, r=8, p=2.
File: derive.test.js
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