Xifrar i desxifrar AES
Please read before use
• This tool runs entirely in your browser. No plaintext, ciphertext, or key is sent to a server.
• It is intended for development, debugging, learning and self-managed scenarios. Do not use this page as the only protection for production secrets, customer data, or anything that requires auditing.
• For real applications: use audited libraries (libsodium, OpenSSL, AWS Encryption SDK), a real KDF (Argon2id ≥ 1 iteration / 64 MiB), AEAD modes only, and manage keys on the server with proper access control.
Text UTF-8
Mode comparison — GCM vs CBC vs CTR▼
| Mode | Authentication | IV requirement | Performance | Recommended use |
|---|---|---|---|---|
| AES-GCM | Yes (AEAD, 128-bit tag) | 12 bytes (recommended); never reuse with same key | Fast, hardware-accelerated | Default — modern API, file encryption, anything authenticated |
| AES-CBC | No — must add HMAC/MAC | 16 bytes; unpredictable (CSPRNG) and never reuse | Fast, hardware-accelerated | Legacy TLS, disk encryption (XTS-AES), never use raw for new designs |
| AES-CTR | No — must add HMAC/MAC | 16 bytes; never reuse with same key (catastrophic if reused) | Fastest, parallelizable | Random-access streams, disk encryption, but combine with MAC |
Reading the table
- • AES-GCM is the only AEAD among the three — it both encrypts and authenticates in one step. If you don't know which to choose, choose GCM.
- • CBC and CTR only provide confidentiality. They need a separate MAC (HMAC-SHA256, compute-then-MAC) or they are vulnerable to chosen-ciphertext and bit-flipping attacks.
- • Both IV and nonce must be unique per (key, message). GCM with a reused IV leaks the authentication key — treat as catastrophic.
Notes sobre modes i formats
- • El SubtleCrypto del navegador només ofereix GCM, CBC i CTR per a AES — no ECB, CFB ni OFB (per evitar usos febles). Per a altres modes, utilitza OpenSSL o una biblioteca de servidor.
- • Format del text xifrat a triar: Hex / Base64 / Base64URL, compatible amb CyberChef, APIs, JWT, etc. Tots dos costats (xifratge i desxifratge) han d'usar el mateix format.
- • En AES-GCM, la sortida és un flux continu de «text xifrat + etiqueta d'autenticació»; l'eina codifica tot el bloc en el format seleccionat — enganxeu tot el bloc en desxifrar.
Notes
- • Web Crypto s'executa íntegrament al navegador; GCM és xifratge autenticat, adequat per a escenaris per defecte.
- • En xifrar, deixeu l'IV buit: l'eina generarà un IV aleatori i l'omplirà a dalt per a reutilitzar-lo en desxifrar.
- • En desxifrar, deixeu l'IV buit per a intentar un vector nul (només vàlid si l'altra part usa la mateixa convenció).
Eina online gratuïta per xifrar i desxifrar AES amb AES-CBC, AES-GCM i AES-CTR. Admet claus AES-128/192/256, formats de text xifrat Hex/Base64/Base64URL, derivació de clau amb contrasenya PBKDF2-SHA256, generació aleatòria d'IV/salt i processament Web Crypto només al navegador.