[WebXR] Add IOSurface to FrameData::LayerData
[WebKit-https.git] / Websites / webkit.org / demos / webcrypto / pbkdf2.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4     <meta charset="UTF-8">
5     <title>WebCrypto API Demo: PBKDF2</title>
6     <style>
7     .inner
8     {
9         display: inline-block;
10     }
11     </style>
12     <script type="text/javascript" src="common.js"></script>
13     <script type="text/javascript">
14     function PBKDF2()
15     {
16         var rawKey = document.getElementById("password").value;
17
18         crypto.subtle.importKey("raw", asciiToUint8Array(rawKey), "PBKDF2", false, ["deriveBits"]).then(function(baseKey) {
19             return crypto.subtle.deriveBits({name: "PBKDF2", salt: crypto.getRandomValues(new Uint8Array(16)), iterations: 100000, hash: "sha-256"}, baseKey, 128);
20         }, failAndLog).then(function(result) {
21             document.getElementById("derivedKey").innerHTML = bytesToHexString(result);
22         }, failAndLog);
23     }
24     </script>
25 </head>
26 <body>
27     <h1>PBKDF2</h1>
28     <p>Click the following button multiple times to see how random salts can strengthen password hashes.</p>
29     <div>
30         Password: <input type="text" id="password" value="123456789">
31         <button type="button" onclick="PBKDF2()" class="inner">derive</button>
32         <div id="derivedKey" class="inner"></div>
33     </div>
34 </body>
35 </html>