Use hmac instead of a second pbkdf
This commit is contained in:
parent
df52a0ef95
commit
49fbf2c849
4 changed files with 51 additions and 28 deletions
|
|
@ -23,6 +23,17 @@ module.exports = {
|
|||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {string} key
|
||||
* @param {string} data
|
||||
* @return {string} base64 encoded hmac
|
||||
*/
|
||||
hmac: function(key, data) {
|
||||
return sjcl.codec.base64.fromBits(
|
||||
new sjcl.misc.hmac(key, sjcl.hash.sha256).encrypt(data)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {string} password
|
||||
* @param {string} salt - base64 encoded, defaults to 'mjuBtGybi/4='
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue