Merge pull request #1737 from eordano/fix/passphrase

Passphrase getting generated correctly
This commit is contained in:
Matias Alejo Garcia 2014-11-10 20:12:30 -03:00
commit e8a376cf31
5 changed files with 242 additions and 10 deletions

View file

@ -24,6 +24,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='