diff --git a/index.html b/index.html
index c0d08b9..863184f 100644
--- a/index.html
+++ b/index.html
@@ -11,7 +11,8 @@
margin: 20px;
}
- form {
+ form,
+ #displform {
max-width: 400px;
margin: auto;
}
@@ -67,8 +68,9 @@
function togglePassword() {
const passwordInput = document.getElementById('passwordInput');
- const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
+ const type = (passwordInput.getAttribute('type') === 'password') ? 'text' : 'password';
passwordInput.setAttribute('type', type);
+ document.querySelector('.view-password').innerText = (type === 'text') ? '🔒' : '👁️';
}
async function sendToServer() {
@@ -77,7 +79,7 @@
const isEncrypt = document.getElementById('encryptToggle').checked;
const endpoint = isEncrypt ? '/encrypt' : '/decrypt';
- const r = await fetch(endpoint, {
+ fetch(endpoint, {
method: 'POST',
body: formData,
})
@@ -98,17 +100,35 @@
alert("ERROR!");
});
}
+
+ async function getSaltAndIv() {
+ const response = await fetch('/getsaltandiv', { method: 'POST' });
+ const siv = await response.json();
+ const el = document.querySelector('#salivdisp');
+ el.innerHTML = `IV: ${siv.iv}Salt: ${siv.salt}`;
+ }