AES Encryption Tool (AES-128/192/256)
Encrypt text with AES-128/192/256 in CBC, GCM, CTR, CFB, OFB or ECB. OpenSSL-compatible passphrase mode or raw hex key + IV. Runs in your browser.
Output uses the OpenSSL "Salted__" format in Base64: an 8-byte random salt followed by the ciphertext. Key and IV are derived from the passphrase and the salt, so the same text gives a different result every time. Equivalent command:
openssl enc -aes-256-cbc -md md5 -a -A -k '…'Runs entirely in your browser. Your data is never uploaded.
What is AES Encryption?
Encrypts text or hex data with AES, the standard block cipher (FIPS 197). You can derive the key from a passphrase in the OpenSSL "Salted__" format, so openssl enc and CryptoJS can decrypt the result, or supply a raw key and IV in hex for interoperability with code. CBC, CFB, CTR, OFB, ECB and authenticated GCM modes are supported.
How to use AES Encryption
- Keep Key source on Passphrase (OpenSSL-compatible) and type a Passphrase, or switch to Raw key + IV (hex) and enter the exact key and IV in hex.
- Choose the Mode and Padding (CBC with PKCS#7 is the OpenSSL default); for raw keys you can also pick GCM and optional additional authenticated data.
- Type or paste the Plaintext (or switch the input encoding to Hex for binary data).
- Click Encrypt, pick Base64 or Hex as the Output encoding and copy the ciphertext.
Example
Key 2b7e151628aed2a6abf7158809cf4f3c, IV 000102030405060708090a0b0c0d0e0f, mode CBC, padding None, hex plaintext 6bc1bee22e409f96e93d7e117393172a
7649abac8119b246cee98e9b12e9197d
NIST SP 800-38A F.2.1 test vector, Hex output encoding.
When to use AES Encryption
Use it to produce test data for an application that uses AES, to encrypt a snippet you will decrypt with OpenSSL or CryptoJS, or to learn how modes and padding change the output. Prefer GCM (or CBC plus a separate MAC) for real data, because CBC/CTR/CFB/OFB alone do not detect tampering. Avoid ECB: identical blocks give identical ciphertext. For files or long-term secrets use a dedicated tool such as age, GnuPG or your platform's encryption APIs.
How AES Encryption works
AES encrypts 16-byte blocks with a 128, 192 or 256-bit key (10, 12 or 14 rounds). In passphrase mode a random 8-byte salt is generated and the key and IV are derived with OpenSSL's EVP_BytesToKey (MD5, one iteration – the openssl enc -md md5 and CryptoJS default) or with PBKDF2-HMAC-SHA256 (openssl enc -pbkdf2); the output is Base64 of Salted__ + salt + ciphertext. In raw mode your hex key and IV are used directly and only the ciphertext is returned. CBC and ECB use PKCS#7 (or zero/no) padding; CFB, OFB and CTR are stream modes without padding. GCM uses the browser's Web Crypto API with a 12-byte nonce and appends the 16-byte authentication tag. The implementation passes the NIST SP 800-38A and GCM test vectors.
Common Use Cases
- Create an
openssl enc -aes-256-cbccompatible ciphertext without a terminal - Reproduce the output of
CryptoJS.AES.encrypt(text, passphrase)for debugging - Generate AES-GCM test vectors (ciphertext + tag) for a backend implementation
- Encrypt a short secret with a raw 256-bit key and IV to paste into a config file
- Demonstrate why ECB mode leaks patterns compared with CBC or CTR
Security Note
Everything runs locally in your browser; nothing is uploaded. EVP_BytesToKey with MD5 is a weak, fast key derivation kept for compatibility – choose PBKDF2 with many iterations, or a random raw key, for anything important. Encryption without authentication (CBC, CTR, CFB, OFB) does not detect modification.
FAQs
Is the output compatible with OpenSSL?
Yes. In passphrase mode the result is exactly what openssl enc -aes-256-cbc -md md5 -a -A -k <passphrase> produces (EVP_BytesToKey with MD5), or -pbkdf2 -iter N when you choose PBKDF2-HMAC-SHA256. Add -d to decrypt. The page shows the matching command under the passphrase field.
Why do I get a different ciphertext every time?
Passphrase mode uses a new random salt for each encryption, so key, IV and ciphertext change. That is intended; any of the outputs decrypts with the same passphrase. Raw-key mode is deterministic for the same key, IV and input.
Which mode should I choose?
GCM, because it also authenticates the data (decryption fails if anything was changed). If the receiving side only supports openssl enc, use CBC – OpenSSL enc does not support GCM. Never reuse a GCM nonce or a CTR counter with the same key.
What is the difference between passphrase and raw key?
A passphrase is turned into a key with a key-derivation function and a salt that is stored in the output. A raw key is used exactly as typed (16, 24 or 32 bytes for AES-128/192/256) together with an IV that you must share separately.