Hashes/Cripto
AES Encrypt/Decrypt
Cifra y descifra texto con AES-GCM o AES-CBC usando una contraseña (clave derivada mediante 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.
Artículo sobre esta herramienta: AES: cómo funciona el cifrado simétrico
Preguntas frecuentes
¿Qué tamaños de clave admite AES aquí y cuál debería usar?
AES admite claves de 128, 192 y 256 bits. AES-256 es la recomendación habitual para aplicaciones nuevas, ya que 128 bits ya se considera seguro, pero 256 ofrece margen extra con un coste práctico insignificante.
¿Cuál es la diferencia entre los modos de cifrado (como CBC, GCM)?
GCM autentica el texto cifrado mientras cifra, por lo que también detecta manipulaciones, siendo la opción recomendada por defecto. CBC solo cifra y necesita un MAC aparte para la integridad, además de un IV aleatorio en cada cifrado para mantenerse seguro.
¿Se envía mi clave o texto plano a algún sitio?
No. Todo el cifrado y descifrado se ejecuta localmente en tu navegador mediante la Web Crypto API — nada se sube a un servidor.
¿Por qué no se debe usar el modo ECB?
ECB cifra cada bloque de forma independiente e idéntica, por lo que bloques iguales de texto plano dan bloques iguales de texto cifrado — esto revela la estructura de los datos (por ejemplo, patrones repetidos en una imagen siguen siendo visibles incluso cifrados). CBC o GCM con un IV único eliminan este problema.
¿Qué pasa si se reutiliza el mismo IV con la misma clave?
Para GCM es un error crítico — reutilizar el par clave+IV compromete por completo la confidencialidad y autenticidad del cifrado. El IV siempre debe ser único para cada cifrado con la misma clave.