Skip to content

Instantly share code, notes, and snippets.

@calvinmetcalf
Created November 26, 2014 00:15
Show Gist options
  • Save calvinmetcalf/7bc5dd44770eb163e018 to your computer and use it in GitHub Desktop.
Save calvinmetcalf/7bc5dd44770eb163e018 to your computer and use it in GitHub Desktop.
crypto.subtle.importKey('raw', password, {name:'PBKDF2'}, false, ['deriveBits']).then(function (key) {
return crypto.subtle.deriveBits({
name: 'PBKDF2',
iterations: iterations,
salt: salt,
hash: 'SHA-1'
}, key, keylen);
}).then(function (result) {
// your key
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment