Hashes/Crypto
AES Encrypt/Decrypt
Encrypt and decrypt text with AES-GCM or AES-CBC using a password (key derived via 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.
Article about this tool: AES: how symmetric encryption works
Frequently asked questions
What key sizes does AES support here, and which should I use?
AES supports 128, 192, and 256-bit keys. AES-256 is the common recommendation for new applications, since 128-bit is already considered secure but 256-bit gives extra margin with negligible practical cost.
What's the difference between the cipher modes (like CBC, GCM)?
GCM authenticates the ciphertext as it encrypts, so it also detects tampering, making it the recommended default. CBC only encrypts and needs a separate MAC for integrity, and requires a random IV per encryption to stay secure.
Is my key or plaintext sent anywhere?
No. All encryption and decryption run locally in your browser via the Web Crypto API — nothing is uploaded to a server.
Why shouldn't I use ECB mode?
ECB encrypts each block independently and identically, so identical plaintext blocks produce identical ciphertext blocks — this leaks the structure of the data (for example, repeating patterns in an image remain visible even when encrypted). CBC or GCM with a unique IV avoid this problem.
What happens if I reuse the same IV with the same key?
For GCM, this is a critical mistake — reusing a key+IV pair completely compromises both the confidentiality and authenticity of the encryption. An IV must always be unique for every encryption performed with the same key.