From a6ff77c81fb331b2bef94fa9ab399a697e8a21d5 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Wed, 28 Dec 2022 19:12:58 -0500 Subject: [PATCH] encryption.js: fix password not being used --- encryption.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/encryption.js b/encryption.js index 04f742a..3a00900 100644 --- a/encryption.js +++ b/encryption.js @@ -8,7 +8,7 @@ function getMsgEncoding () { } function getKeyMaterial () { - let pass = document.getElementById("password"); + let pass = document.getElementById("password").value; let enc = new TextEncoder(); return window.crypto.subtle.importKey( "raw", @@ -91,7 +91,6 @@ async function enc () { outBox.innerHTML = `${bufTo64(output)}`; let keyExp = await exportKey (key); - window.alert(bufTo64(iv)); } async function dec () { @@ -120,6 +119,6 @@ async function dec () { let dec = new TextDecoder(); outBox.innerHTML = `${dec.decode(plaintext)}`; } catch (e) { - window.alert(e.name); + window.alert("Decryption error: incorrect password?"); } }