AES Encryption & Decryption
Encrypt and decrypt text with AES-128, 192 or 256 — GCM, CBC, CTR and more.
You'll need it again to decrypt. Nothing you type leaves this page.
OpenSSL's default is 10,000. Any number works: more makes the password slower to guess; decrypting needs the same number.
The usual choice with OpenSSL. Needs an IV; pads to whole blocks.
openssl enc -aes-256-cbc -pbkdf2 -iter 10000 -a -AOpenSSL asks for the password; paste the text into it, or add -in and -out files.
Encrypt text with AES-256 — or AES-128 or AES-192 — using a password or your own key and IV, or paste AES ciphertext in Base64 or hex to decrypt it. With a password, the result has the same format as openssl enc -pbkdf2: the Salted__ header, a random 8-byte salt and the ciphertext, with the key and IV derived by PBKDF2-HMAC-SHA256. The defaults, AES-256 in CBC mode with PKCS#7 padding and Base64 output, match openssl enc -aes-256-cbc -pbkdf2 -a, and GCM, CTR, CFB, OFB and ECB are one click away. The result updates as you type. It all happens in your browser, so your text, password and key never leave your device; it's free and needs no sign-up.
How to encrypt and decrypt text with AES
- Choose Encrypt or Decrypt. Type the text to encrypt, or paste the Base64 or hex text to decrypt — the format is detected automatically.
- Enter a password (Generate makes a strong one), or switch to Key & IV (hex) and enter or generate a key and IV of the length shown.
- Pick the key size (128, 192 or 256 bits) and the mode. To decrypt, use the same password, iteration count, key size and mode that encrypted the text.
- Copy or download the result, or press Swap to move it into the input and flip the direction. Under Same with OpenSSL, the page shows the matching openssl command, without your password.
Features
- AES-128, AES-192 and AES-256 in CBC, GCM, CTR, CFB, OFB or ECB mode
- Password mode in the openssl enc -pbkdf2 format: Salted__ header, random 8-byte salt, key and IV from PBKDF2-HMAC-SHA256
- 10,000 (OpenSSL's default), 100,000 or 600,000 PBKDF2 iterations, or any number up to 10 million
- Key & IV mode with your own hex key and IV, or random ones from Generate
- AES-GCM detects a wrong password or key and any change to the ciphertext
- PKCS#7 padding, or none in CBC and ECB
- Base64 or hex output; Base64 or hex input recognized automatically
- The matching openssl enc command for every mode but GCM
Is it private?
Yes. AES runs in WebAssembly inside your browser, and the password is turned into a key by the browser's own Web Crypto. Your text, password and key are never uploaded or saved, and the openssl command the page shows never contains them.
Frequently asked questions
Which AES mode should I use?
For new data, GCM: besides encrypting, it detects any change to the text and a wrong password. Choose CBC, the default, when the other side uses openssl enc, which can't read GCM; choose CTR, CFB or OFB only to match an existing system. Avoid ECB: identical 16-byte blocks give identical output, so patterns in the text show through.
Can I decrypt the result with OpenSSL?
Yes, except GCM. With the defaults: echo 'U2FsdGVkX1…' | openssl enc -d -aes-256-cbc -pbkdf2 -iter 10000 -a -A — OpenSSL then asks for the password. Change 256 and cbc to your key size and mode (ecb, ctr, cfb, ofb), -iter to your iteration count, and add -nopad if you turned padding off; for hex output, drop -a -A and pipe the text through xxd -r -p first. For Key & IV mode, use -K <key hex> -iv <IV hex> instead of -pbkdf2 -iter. openssl enc refuses GCM (AEAD ciphers are not supported), so GCM text can only be read here or in code.
Why is the result different every time?
Because every encryption with a password picks a new random salt, so the key, the IV and the whole output change each time — and every version decrypts to the same text. That is on purpose: nobody can tell that two messages are equal. In Key & IV mode the output repeats when the key and IV do, so generate a new IV for every message: reusing one with the same key weakens CBC and breaks CTR and GCM.
Why does it say the password is wrong?
Because something doesn't match: the password, iteration count, key size, mode and padding must all be the ones used to encrypt, and the text stores only the salt. Text that starts with U2FsdGVkX1 but was made by openssl enc without -pbkdf2, or by CryptoJS with a passphrase, uses an older key derivation (EVP_BytesToKey) that this page doesn't read — re-encrypt it with -pbkdf2, or use Key & IV mode if you have the raw key and IV.
Is AES-256 encryption secure?
Yes. AES has no practical attack, at any key size; the weak point is the password. Use a long random one (Generate makes one) and, when you control both sides, raise the iterations to 600,000, OWASP's current figure for PBKDF2-HMAC-SHA256. Choose GCM if you also need to know the text wasn't altered.