From 9363ffddeb185bf4625ac149b2e6043f915714e4 Mon Sep 17 00:00:00 2001 From: sirpy Date: Thu, 18 Feb 2021 10:07:20 +0200 Subject: [PATCH] fix: salt should not be random #1052 see #1052 this causes hash tables to fail, because a different hash will be generated for content every time. in case incomming salt is null, it will be set to always be the empty string --- sea.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sea.js b/sea.js index ca0b1b3c..d533d23e 100644 --- a/sea.js +++ b/sea.js @@ -278,7 +278,7 @@ if(cb){ try{ cb(rsha) }catch(e){console.log(e)} } return rsha; } - salt = salt || shim.random(9); + salt = salt || ''; var key = await (shim.ossl || shim.subtle).importKey('raw', new shim.TextEncoder().encode(data), {name: opt.name || 'PBKDF2'}, false, ['deriveBits']); var work = await (shim.ossl || shim.subtle).deriveBits({ name: opt.name || 'PBKDF2',