//NOTE: This prompts the user to enter a password.
window.crypto.subtle.generateKey(
{
name: "PBKDF2",
},
false, //whether the key is extractable
["deriveKey", "deriveBits"] //can be any combination
)
.then(function(key){
//returns a key object
console.log(key);
})
.catch(function(err){
console.error(err);
});