Hash/Crittografia
AES Encrypt/Decrypt
Cifra e decifra testo con AES-GCM o AES-CBC usando una password (chiave derivata tramite PBKDF2).
AES is the standard for symmetric encryption: the same password is used to both encrypt and decrypt. This tool derives an encryption key from your password with PBKDF2 and encrypts text with AES-GCM or AES-CBC — all locally in your browser.
How to use it
- Encrypt: enter text and a password, pick a mode (GCM or CBC), and get an encrypted result along with the parameters (salt, IV) needed to decrypt it later.
- Decrypt: paste the encrypted text and the same password to get the original back.
- AES-GCM is the recommended default: it encrypts and verifies data integrity at the same time (authenticated encryption).
Common uses
- Encrypting sensitive text before storing it or sending it over an untrusted channel.
- Checking that an AES encryption implementation matches across different languages or libraries.
- A teaching example for understanding the difference between the GCM and CBC encryption modes.
Things to keep in mind
The IV (initialization vector) must be unique for every encryption performed with the same key — reusing a key+IV pair in GCM completely breaks the encryption's security.
AES-CBC without a separate integrity check (a MAC) is vulnerable to ciphertext-tampering attacks — that's why GCM, which combines encryption and authentication in one mode, is the safer default.
Articolo su questo strumento: AES: come funziona la crittografia simmetrica
Domande frequenti
Quali dimensioni di chiave supporta AES qui, e quale dovrei usare?
AES supporta chiavi a 128, 192 e 256 bit. AES-256 è la raccomandazione comune per le nuove applicazioni, poiché 128 bit è già considerato sicuro, ma 256 bit offre un margine extra con un costo pratico trascurabile.
Qual è la differenza tra le modalità cifrario (come CBC, GCM)?
GCM autentica il testo cifrato durante la cifratura, quindi rileva anche le manomissioni, rendendola l'opzione predefinita consigliata. CBC cifra soltanto e richiede un MAC separato per l'integrità, oltre a un IV casuale a ogni cifratura per restare sicura.
La mia chiave o il testo in chiaro vengono inviati da qualche parte?
No. Tutta la cifratura e decifratura avviene localmente nel tuo browser tramite la Web Crypto API — nulla viene caricato su un server.
Perché non conviene usare la modalità ECB?
ECB cifra ogni blocco in modo indipendente e identico, quindi blocchi identici di testo in chiaro producono blocchi identici di testo cifrato — questo rivela la struttura dei dati (ad esempio, pattern ripetuti in un'immagine restano visibili anche una volta cifrati). CBC o GCM con un IV unico eliminano questo problema.
Cosa succede se si riutilizza lo stesso IV con la stessa chiave?
Per GCM è un errore critico — il riutilizzo della coppia chiave+IV compromette completamente la riservatezza e l'autenticità della cifratura. L'IV deve sempre essere unico per ogni cifratura con la stessa chiave.