aboutsummaryrefslogtreecommitdiff
path: root/html/index.html
diff options
context:
space:
mode:
authorgrant-kun <[email protected]>2022-10-04 09:49:49 -0500
committergrant-kun <[email protected]>2022-10-04 09:49:49 -0500
commit316f87b936c589a04e38e31dfa20369487214b97 (patch)
treedc8f1e5c6e2ce0a91c2fdf5c2df2a05f6a9fd2a3 /html/index.html
parent0a9e7217d031fc47e7620b8a9d938fda6fa0ce9c (diff)
http(s)
Diffstat (limited to 'html/index.html')
-rw-r--r--html/index.html11
1 files changed, 8 insertions, 3 deletions
diff --git a/html/index.html b/html/index.html
index 4dcc8de..354eb04 100644
--- a/html/index.html
+++ b/html/index.html
@@ -103,7 +103,10 @@
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState == XMLHttpRequest.DONE) {
- alert(xhr.responseText);
+ let dec = (kekw.decrypt(JSON.parse(xhr.responseText).data));
+ if (JSON.parse(xhr.responseText).html) {
+ document.body.innerHTML = dec
+ }
}
}
let user = document.getElementById('user').value
@@ -120,7 +123,8 @@
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState == XMLHttpRequest.DONE) {
- pub = (xhr.responseText);
+ pub = kekw.decrypt(JSON.parse(xhr.responseText).data);
+ return pub
}
}
let out = {}
@@ -146,9 +150,10 @@
submit()
}
};
+ let kekw
let mypriv, mypub
async function load() {
- let kekw = await nodersa({ b: 512 })
+ kekw = await nodersa({ b: 512 })
mypriv = await kekw.exportKey('pkcs1-private')
mypub = await kekw.exportKey('pkcs8-public')
console.log(mypub)