summaryrefslogtreecommitdiff
path: root/genkey.html
blob: 914d55013f8ee32b6b6ead0fde1850e8578a3043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<html>
<head>
  <script src="/encrypt_key.js"></script>
  <script>
    window.sodium = {
      onload: function (sodium) {
        var sodium = sodium;
        update();
      }
    };
    function update() {
      let password = document.getElementById("password").value;
      let key = sodium.crypto_sign_keypair('hex');
      encryptedPrivateKey = encrypt_private_key(password, key.privateKey);
      document.getElementById("output").innerHTML =
         'echo "' + encryptedPrivateKey + '<br>' +
         key.publicKey + '" >key.ed25519;';
    }
  </script>
  <script src="/sodium.js" async></script>
</head>
<body>
<input type="password" id="password" onchange="update();" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();">
<p id="output"></p>
</body>
</html>