Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <button onclick="test()">pbkdf2</button>
  <pre id="pre"></pre>
</body>
</html>
 
function test() {
  var now = performance.now();
  crypto.subtle.importKey('raw', crypto.getRandomValues(new Uint8Array(16)), { name: "PBKDF2" }, false, ["deriveKey", "deriveBits"]).then(function(key) {
    crypto.subtle.deriveKey({
      "name": "PBKDF2",
      salt: window.crypto.getRandomValues(new Uint8Array(16)),
      iterations: 1000000,
      hash: {name: "SHA-1"}
    }, key, { name: "AES-CBC", length: 256 }, false, ["encrypt", "decrypt"])
    .then(function(key) {
      pre.innerHTML = Math.round(performance.now() - now) + 'ms';
    });
  });
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
antellepro
0viewers