encodedPassword,
'PBKDF2',
false,
- ['deriveKey'],
+ ['deriveKey']
);
const key = await crypto.subtle.deriveKey(
name: 'PBKDF2',
hash: 'SHA-512',
salt,
- iterations: 400_000,
+ iterations: 400_000
},
keyMaterial,
{ name: 'AES-GCM', length: 256 },
const encodedPlaintext = new Uint8Array(await crypto.subtle.decrypt(
{ name: 'AES-GCM', iv },
key,
- ciphertext,
+ ciphertext
));
const plaintext = new TextDecoder().decode(encodedPlaintext);
encodedPassword,
'PBKDF2',
false,
- ['deriveKey'],
+ ['deriveKey']
);
const key = await crypto.subtle.deriveKey(
name: 'PBKDF2',
hash: 'SHA-512',
salt,
- iterations: 400_000,
+ iterations: 400_000
},
keyMaterial,
{ name: 'AES-GCM', length: 256 },
const ciphertext = new Uint8Array(await crypto.subtle.encrypt(
{ name: 'AES-GCM', iv },
key,
- encodedPlaintext,
+ encodedPlaintext
));
const contentBuffer = new Uint8Array(salt.byteLength + iv.byteLength + ciphertext.byteLength);