Upload files to "get"

This commit is contained in:
2026-03-27 18:58:15 +01:00
parent 9909f08613
commit e5f9036b08
5 changed files with 387 additions and 0 deletions

77
get/cesare.html Normal file
View File

@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<title>CryptoSeals - Cesare</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar">
<a href="index.html" class="nav-brand">
<img src="logo.png" alt="🦭" onerror="this.style.display='none'; this.nextElementSibling.style.display='inline';">
<span style="display:none;">🦭</span> CryptoSeals
</a>
<ul class="nav-links">
<li><a href="rsa.html">Algoritmo RSA</a></li>
<li><a href="cesare.html" style="color: #3498db;">Cesare</a></li> <li><a href="vigenere.html">Vigenère</a></li>
<li><a href="storia.html">La Storia</a></li>
<li><a href="team.html">Il Team</a></li>
</ul>
</nav>
<div class="container">
<h1>Cifrario di Cesare</h1>
<p class="descrizione">Sposta le lettere dell'alfabeto di un numero fisso di posizioni. Semplice, storico, ma efficace per messaggi veloci.</p>
<div class="crypto-box">
<label>Chiave (Numero di spostamento):</label>
<input type="number" id="chiaveCesare" value="3" placeholder="Es. 3" style="width: 100%; padding: 12px; margin-top: 5px; margin-bottom: 15px; border-radius: 5px; border: 1px solid #ccc;">
<label>Testo in chiaro:</label>
<textarea id="testoInput" placeholder="Scrivi qui il messaggio da cifrare..."></textarea>
<button onclick="cifraCesare()">🔒 Cifra con Cesare</button>
<label style="display:block; margin-top: 25px;">Testo Cifrato:</label>
<textarea id="testoOutput" placeholder="Il risultato cifrato apparirà qui..."></textarea>
<button class="btn-green" onclick="decifraCesare()">🔓 Decifra in chiaro</button>
<label style="display:block; margin-top: 25px;">Risultato decifrato:</label>
<textarea id="testoDecifrato" readonly placeholder="Il messaggio originale tornerà qui..."></textarea>
</div>
</div>
<script>
async function cifraCesare() {
const input = document.getElementById("testoInput").value;
const chiave = document.getElementById("chiaveCesare").value;
if(!input) return alert("Inserisci del testo!");
try {
const risposta = await fetch("http://localhost:8080/api/cesare/cifra", {
method: "POST", headers: { "Content-Type": "application/json" },
// Invia il testo e la CHIAVE (convertita in numero) al server
body: JSON.stringify({ testo: input, chiave: parseInt(chiave) })
});
document.getElementById("testoOutput").value = await risposta.text();
} catch (e) { alert("Errore di connessione con le API di Cesare!"); }
}
async function decifraCesare() {
const inputCifrato = document.getElementById("testoOutput").value;
const chiave = document.getElementById("chiaveCesare").value;
if(!inputCifrato) return alert("Nessun testo da decifrare!");
try {
const risposta = await fetch("http://localhost:8080/api/cesare/decifra", {
method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ testo: inputCifrato, chiave: parseInt(chiave) })
});
document.getElementById("testoDecifrato").value = await risposta.text();
} catch (e) { alert("Errore di connessione!"); }
}
</script>
</body>
</html>

47
get/index.html Normal file
View File

@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<title>CryptoSeals - Home</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar">
<a href="index.html" class="nav-brand">
<img src="seal1.png" height="80" alt="🦭" onerror="this.style.display='none'; this.nextElementSibling.style.display='inline';">
<span style="display:none;"><img src="seal1.png"></span> CryptoSeals
</a>
<ul class="nav-links">
<li><a href="rsa.html">Algoritmo RSA</a></li>
<li><a href="cesare.html">Cesare</a></li>
<li><a href="vigenere.html">Vigenère</a></li>
<li><a href="team.html">Il Team</a></li>
</ul>
</nav>
<div></div>
<div class="container">
<h1>Welcome to CryptoSeals</h1>
<p class="descrizione">
Dive deep, Seal your data.<br>
<br><br>
<i>Click any tool in the bar on the right to start!</i>
</p>
<img src="/target/classes/seal1.png" alt="Mascotte CryptoSeals" style="max-width: 300px; border-radius: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.1);" onerror="this.style.display='none';">
</div>
<footer>
<div class="copyright">
<span>
<a href="/privacy-policy/">Privacy Policy</a> &nbsp;
</span>
<span>
© <span class="" data-timestamp="2026-03-26T11:39:53Z" data-function="format" data-format="YYYY" data-refresh="0">2026</span> CryptoSeals
</span>
</div>
</footer>
</body>
</html>

95
get/rsa.html Normal file
View File

@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<title>CryptoSeals - RSA</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar">
<a href="index.html" class="nav-brand">
<span><img src="seal1.png" height="80"onerror="this.style.display='none'; this.nextElementSibling.style.display='inline';"></span> CryptoSeals
</a>
<ul class="nav-links">
<li><a href="rsa.html" class="active">Algoritmo RSA</a></li>
<li><a href="cesare.html">Cesare</a></li>
<li><a href="vigenere.html">Vigenère</a></li>
<li><a href="storia.html">La Storia</a></li>
<li><a href="team.html">Il Team</a></li>
</ul>
</nav>
<div class="container">
<h1>Motore RSA</h1>
<p class="descrizione">Cifra e decifra i tuoi messaggi con lo standard di sicurezza a chiave pubblica. Scegli la dimensione delle chiavi, scrivi e lascia fare alle foche.</p>
<div class="crypto-box">
<label>Dimensione Chiave RSA</label>
<select id="keysize">
<option value="512">512 bit (Solo didattico - Veloce)</option>
<option value="1024" selected>1024 bit (Test - Bilanciato)</option>
<option value="2048">2048 bit (Standard - Lenta da generare ⏳)</option>
<option value="4096">4096 bit (Alta sicurezza - Molto lenta ⏳⏳)</option>
</select>
<div class="crypto-columns">
<div class="crypto-col">
<label>Testo in chiaro</label>
<textarea id="plaintext" class="pulse-textarea" placeholder="Scrivi il messaggio segreto che vuoi proteggere..."></textarea>
<button onclick="encrypt()">🔒 Cifra il messaggio</button>
</div>
<div class="crypto-col">
<label>Testo Cifrato (Base64)</label>
<textarea id="ciphertext" placeholder="Il testo protetto apparirà qui..."></textarea>
<button class="btn-green" onclick="decrypt()">🔓 Decifra il messaggio</button>
</div>
</div>
<div style="margin-top: 35px;">
<label>Risultato finale decifrato</label>
<textarea id="decodedtext" readonly placeholder="Il messaggio originale apparirà qui dopo la decifratura..." style="height: 100px; background-color: #0b0f19; border-color: rgba(16, 185, 129, 0.3); color: #10b981;"></textarea>
</div>
</div>
</div>
<script>
async function encrypt() {
const plaintext = document.getElementById("plaintext").value;
const size = document.getElementById("keysize").value;
if(!plaintext) return alert("Per favore, inserisci del testo da cifrare.");
document.getElementById("ciphertext").value = "Le foche stanno cifrando... Attendere prego.";
try {
// 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", {
method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: plaintext, keysize: parseInt(size) })
});
document.getElementById("ciphertext").value = await res.text();
} catch (e) { alert("Impossibile connettersi al server Javalin."); }
}
async function decrypt() {
const input = document.getElementById("ciphertext").value;
if(!input) return alert("Non c'è nessun testo da decifrare.");
document.getElementById("decodedtext").value = "Decifratura in corso...";
try {
// 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", {
method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: input })
});
document.getElementById("decodedtext").value = await res.text();
} catch (e) { alert("Impossibile connettersi al server."); }
}
</script>
</body>
</html>

BIN
get/seal1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

168
get/style.css Normal file
View File

@@ -0,0 +1,168 @@
/* Importiamo Inter per la massima leggibilità */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
/* --- STILI BASE (DARK) --- */
body, h1, h2, p, ul, li { margin: 0; padding: 0; }
body {
font-family: 'Inter', system-ui, -apple-system, sans-serif;
background-color: #0c1221; /* Fondo quasi nero, molto profondo */
color: #f1f5f9; /* Testo chiaro ghiaccio */
padding-top: 100px;
-webkit-font-smoothing: antialiased; /* Rende il font più nitido su Mac */
}
footer {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-between;
font-size: 0.85em;
position: absolute;
padding-top: 1rem;
z-index: 1050;
width: 100%;
margin-top: 3rem;
background: var(--color-bg-footer);
box-shadow: inset 0 2px 5px 0 rgba(0, 0, 0, 0.16),
inset 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}
footer {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-between;
font-size: 0.85em;
position: absolute;
padding-top: 1rem;
z-index: 1050;
width: 100%;
margin-top: 3rem;
background: var(--color-bg-footer);
box-shadow: inset 0 2px 5px 0 rgba(0, 0, 0, 0.16),
inset 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}
footer .copyright {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
margin-top: 2rem;
padding: 1.5rem 2em;
text-align: right;
border-top: 1px solid #ffffff10;
}
/* --- NAVBAR (EFFETTO VETRO SCURO) --- */
.navbar {
background-color: rgba(17, 24, 39, 0.8);
backdrop-filter: blur(12px); /* Effetto vetro sfocato */
position: fixed;
top: 0;
width: 100%;
height: 75px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 40px;
box-sizing: border-box;
z-index: 1000;
border-bottom: 1px solid #1e293b;
}
.nav-brand { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; color: #f1f5f9; text-decoration: none; letter-spacing: -0.5px;}
.nav-brand span { font-size: 28px; color: #0688d4; /* Accento Ciano Ghiaccio */ }
.nav-links { list-style: none; display: flex; gap: 30px; }
.nav-links a { color: #94a3b8; text-decoration: none; font-weight: 500; font-size: 15px; transition: 0.2s;}
.nav-links a:hover, .nav-links a.active { color: #06b6d4; font-weight: 600; }
/* --- CONTENITORE CENTRALE --- */
.container { max-width: 1100px; margin: 0 auto 60px auto; padding: 20px; text-align: center; }
h1 { font-size: 48px; color: #f1f5f9; margin-bottom: 15px; font-weight: 900; letter-spacing: -1.5px; }
p.descrizione { font-size: 18px; color: #94a3b8; line-height: 1.6; margin-bottom: 50px; max-width: 700px; margin-left: auto; margin-right: auto;}
/* --- SCATOLA PRINCIPALE (MODERN DARK) --- */
.crypto-box {
background-color: #111827; /* Slate dark */
margin: 0 auto;
padding: 50px;
border-radius: 28px;
border: 1px solid #1e293b;
box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
text-align: left;
}
label { font-weight: 600; color: #94a3b8; font-size: 14px; margin-bottom: 10px; display: block; text-transform: uppercase; letter-spacing: 1px; }
/* Input, Select, Textarea (Modern Dark) */
textarea, select {
width: 100%;
padding: 18px;
border-radius: 14px;
border: 1px solid #1e293b;
background-color: #1f2937; /* Input leggermente più chiaro */
color: #f1f5f9;
font-family: 'Inter', system-ui, -apple-system, sans-serif;
font-size: 16px;
box-sizing: border-box;
transition: all 0.3s ease;
margin-bottom: 25px;
line-height: 1.6;
}
textarea:focus, select:focus { outline: none; border-color: #06b6d4; background-color: #111827; box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15); }
textarea { height: 180px; resize: none; }
textarea::placeholder { color: #4b5563; }
/* --- DEFINIZIONE ANIMAZIONE PULSANTE --- */
@keyframes glitchPulse {
0% { border-color: #1e293b; box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
50% { border-color: #06b6d4; box-shadow: 0 0 15px 2px rgba(6, 182, 212, 0.3); }
100% { border-color: #1e293b; box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}
/* Applichiamo l'animazione alla casella di input principale */
.pulse-textarea {
animation: glitchPulse 2.5s infinite ease-in-out; /* Pulsazione lenta e continua */
}
.pulse-textarea:focus {
animation: none; /* Smette di pulsare quando ci scrivi dentro */
}
/* --- LAYOUT A COLONNE --- */
.crypto-columns {
display: flex;
gap: 35px;
}
.crypto-col {
flex: 1;
display: flex;
flex-direction: column;
}
/* --- BOTTONI--- */
button {
background: linear-gradient(135deg, #0891b2, #06b6d4); /* Ciano Gradient */
color: #0b0f19;
border: none;
padding: 18px 25px;
font-size: 16px;
border-radius: 14px;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 700;
width: 100%;
text-transform: uppercase;
letter-spacing: 1px;
}
button:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(6, 182, 212, 0.3); }
button:active { transform: translateY(-1px); }
/* Bottone Decifra (Verde Neon) */
.btn-green { background: linear-gradient(135deg, #059669, #10b981); color: #0b0f19;}
.btn-green:hover { box-shadow: 0 12px 25px rgba(16, 185, 129, 0.3); }
/* Responsive */
@media (max-width: 800px) {
.crypto-columns { flex-direction: column; gap: 0; }
}