Skip to content

Commit

Permalink
Merge pull request #84 from spacemeshos/fix-unlock-different-kdf-params
Browse files Browse the repository at this point in the history
Use KDF params from the wallet file to decrypt
  • Loading branch information
brusherru authored Sep 12, 2024
2 parents f1ff01d + 76894e2 commit 4c1269a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/aes-gcm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ export const decrypt = async (
const salt = fromHexString(encryptedMessage.kdfparams.salt);
const iv = fromHexString(encryptedMessage.cipherParams.iv);
const cipherText = fromHexString(encryptedMessage.cipherText);
const key = await pbkdf2Key(password, salt);
const key = await pbkdf2Key(
password,
salt,
encryptedMessage.kdfparams.dklen,
encryptedMessage.kdfparams.iterations
);
const decryptedBytes = await subtle.decrypt(
{
name: 'AES-GCM',
Expand Down

0 comments on commit 4c1269a

Please sign in to comment.