return crypto.subtle
.importKey('raw', password, 'PBKDF2', false, ['deriveKey'])
.then(derivationKey => {
- new Uint8Array(password).fill(0)
const derivationAlgorithm: Pbkdf2Params = {
name: 'PBKDF2',
hash: 'SHA-512',
console.error(err)
throw new Error('Failed to derive CryptoKey from password', { cause: err })
})
+ .finally(() => {
+ new Uint8Array(password).fill(0)
+ })
} else if (data.password !== undefined) {
throw new Error('Password is not allowed for this action', { cause: action })
} else {