fixed urls

This commit is contained in:
2026-03-27 22:47:47 +01:00
parent 75698d078f
commit 2565f8f04c
3 changed files with 13 additions and 11 deletions

View File

@@ -50,7 +50,7 @@
if(!input) return alert("Inserisci del testo!"); if(!input) return alert("Inserisci del testo!");
try { try {
const risposta = await fetch("http://localhost:8080/api/cesare/cifra", { const risposta = await fetch("/seal/cesare/encrypt", {
method: "POST", headers: { "Content-Type": "application/json" }, method: "POST", headers: { "Content-Type": "application/json" },
// Invia il testo e la CHIAVE (convertita in numero) al server // Invia il testo e la CHIAVE (convertita in numero) al server
body: JSON.stringify({ testo: input, chiave: parseInt(chiave) }) body: JSON.stringify({ testo: input, chiave: parseInt(chiave) })
@@ -65,7 +65,7 @@
if(!inputCifrato) return alert("Nessun testo da decifrare!"); if(!inputCifrato) return alert("Nessun testo da decifrare!");
try { try {
const risposta = await fetch("http://localhost:8080/api/cesare/decifra", { const risposta = await fetch("/seal/cesare/decrypt", {
method: "POST", headers: { "Content-Type": "application/json" }, method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ testo: inputCifrato, chiave: parseInt(chiave) }) body: JSON.stringify({ testo: inputCifrato, chiave: parseInt(chiave) })
}); });

View File

@@ -36,15 +36,16 @@
<select id="keysize" style="margin-top: 5px; margin-bottom: 20px;"> <select id="keysize" style="margin-top: 5px; margin-bottom: 20px;">
<option value="512">512 bit (Solo didattico - Veloce)</option> <option value="512">512 bit (Solo didattico - Veloce)</option>
<option value="1024" selected>1024 bit (Test - Bilanciato)</option> <option value="1024" selected>1024 bit (Test - Bilanciato)</option>
<option value="2048">2048 bit (Standard - Lenta da generare)</option> <option value="2048">2048 bit (Standard - Lenta da generare)</option>
<option value="4096">4096 bit (Alta sicurezza - Molto lenta ⏳⏳)</option> <option value="3072">3072 bit (Ottima - Mediamente Lenta)</option>
<option value="4096">4096 bit (Alta sicurezza - Molto lenta)</option>
</select> </select>
<div class="crypto-columns"> <div class="crypto-columns">
<div class="crypto-col"> <div class="crypto-col">
<label><i class="fa-solid fa-pen"></i> Testo in chiaro</label> <label><i class="fa-solid fa-pen"></i> Testo in chiaro</label>
<textarea id="plaintext" placeholder="Scrivi il messaggio segreto che vuoi proteggere..."></textarea> <textarea id="plaintext" placeholder="Scrivi il messaggio segreto da decifrare..."></textarea>
<button id="btn-encrypt" onclick="encrypt()"><i class="fa-solid fa-lock"></i> Cifra il messaggio</button> <button id="btn-encrypt" onclick="encrypt()"><i class="fa-solid fa-lock"></i> Cifra il messaggio</button>
</div> </div>
@@ -88,7 +89,7 @@
btn.disabled = true; btn.disabled = true;
try { try {
const res = await fetch("http://localhost:8080/seal/rsa/encrypt", { const res = await fetch("/seal/rsa/encrypt", {
method: "POST", headers: { "Content-Type": "application/json" }, method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: plaintext, keysize: parseInt(size) }) body: JSON.stringify({ text: plaintext, keysize: parseInt(size) })
}); });
@@ -127,7 +128,7 @@
btn.disabled = true; btn.disabled = true;
try { try {
const res = await fetch("http://localhost:8080/seal/rsa/decrypt", { const res = await fetch("/seal/rsa/decrypt", {
method: "POST", headers: { "Content-Type": "application/json" }, method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: input }) body: JSON.stringify({ text: input })
}); });

View File

@@ -30,8 +30,9 @@
<select id="keysize"> <select id="keysize">
<option value="512">512 bit (Solo didattico - Veloce)</option> <option value="512">512 bit (Solo didattico - Veloce)</option>
<option value="1024" selected>1024 bit (Test - Bilanciato)</option> <option value="1024" selected>1024 bit (Test - Bilanciato)</option>
<option value="2048">2048 bit (Standard - Lenta da generare)</option> <option value="2048">2048 bit (Standard - Lenta da generare)</option>
<option value="4096">4096 bit (Alta sicurezza - Molto lenta ⏳⏳)</option> <option value="3072">3072 bit (Ottima - Mediamente Lenta)</option>
<option value="4096">4096 bit (Alta sicurezza - Molto lenta)</option>
</select> </select>
<div class="crypto-columns"> <div class="crypto-columns">
@@ -67,7 +68,7 @@
try { try {
// NOTA: Controlla che la rotta nel tuo Java sia corretta (/seal/rsa/encrypt o /api/rsa/cifra) // NOTA: Controlla che la rotta nel tuo Java sia corretta (/seal/rsa/encrypt o /api/rsa/cifra)
const res = await fetch("http://localhost:8080/seal/rsa/encrypt", { const res = await fetch("/seal/rsa/encrypt", {
method: "POST", headers: { "Content-Type": "application/json" }, method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: plaintext, keysize: parseInt(size) }) body: JSON.stringify({ text: plaintext, keysize: parseInt(size) })
}); });
@@ -83,7 +84,7 @@
try { try {
// NOTA: Controlla che la rotta nel tuo Java sia corretta (/seal/rsa/decrypt o /api/rsa/decifra) // NOTA: Controlla che la rotta nel tuo Java sia corretta (/seal/rsa/decrypt o /api/rsa/decifra)
const res = await fetch("http://localhost:8080/seal/rsa/decrypt", { const res = await fetch("/seal/rsa/decrypt", {
method: "POST", headers: { "Content-Type": "application/json" }, method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: input }) body: JSON.stringify({ text: input })
}); });