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