This commit is contained in:
@@ -36,7 +36,6 @@ public class Seal {
|
||||
String[] ciphertext = Caesar.decode(req.ciphertext);
|
||||
ctx.json(ciphertext);
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
// Cifratura con RSA
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
efficace per messaggi veloci.</p>
|
||||
|
||||
<div class="crypto-box">
|
||||
|
||||
<label>Chiave (Numero di spostamento):</label>
|
||||
<input type="number" id="key" value="3" placeholder="Es. 3"
|
||||
style="width: 100%; padding: 12px; margin-top: 5px; margin-bottom: 15px; border-radius: 5px; border: 1px solid #ccc;">
|
||||
|
||||
@@ -15,13 +15,12 @@ async function encrypt() {
|
||||
}
|
||||
|
||||
async function decrypt() {
|
||||
const ciphertext = document.getElementById("ciphertext").value;
|
||||
|
||||
if (!ciphertext) return alert("Nessun testo da decifrare!");
|
||||
const c = document.getElementById("ciphertext").value;
|
||||
if (!c) return alert("Nessun testo da decifrare!");
|
||||
try {
|
||||
const res = await fetch("/seal/caesar/decrypt", {
|
||||
method: "POST", headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ ciphertext: ciphertext })
|
||||
body: JSON.stringify({ ciphertext: c })
|
||||
});
|
||||
const data = await res.json();
|
||||
document.getElementById("decodedtext").value = JSON.stringify(data, null, 2);
|
||||
|
||||
Reference in New Issue
Block a user