summaryrefslogtreecommitdiff
path: root/genkey.html
diff options
context:
space:
mode:
Diffstat (limited to 'genkey.html')
-rw-r--r--genkey.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/genkey.html b/genkey.html
new file mode 100644
index 0000000..b73f21a
--- /dev/null
+++ b/genkey.html
@@ -0,0 +1,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 =
+ '$privKey = "' + encryptedPrivateKey + '";<br>' +
+ '$pubKey = "' + key.publicKey + '";';
+ }
+ </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>