Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pw = window.crypto.getRandomValues(new Uint8Array(16));
- window.crypto.subtle.importKey("raw", pw, "PBKDF2", false, ["deriveBits"]).then(key => {
- console.log(key);
- var st = window.crypto.getRandomValues(new Uint8Array(16));
- const keySizeBits = 2048;
- // const keySizeBits = 2056; // this breaks
- return window.crypto.subtle.deriveBits({ name: "PBKDF2", salt: st, iterations: 10000, hash: "SHA-256" }, key, keySizeBits);
- }).then(bits => {
- console.log(bits);
- }).catch(err => {
- console.error(err);
- });
Add Comment
Please, Sign In to add comment