How to Use This AES Encryption Tool
- Enter your plain text in the Encrypt panel, or your ciphertext in the Decrypt panel.
- Choose a cipher mode - GCM is recommended for most use cases.
- Select a key size - AES-128, AES-192, or AES-256.
- Enter or generate a secret key using the Generate button. Keep this key safe - it is required for decryption.
- Enter or generate an IV (not needed for ECB mode). Use a random IV for each encryption.
- Click Encrypt or Decrypt and copy the output.
Key Features of AES Encryption
ECB, CBC, CTR & GCM - AES-GCM is recommended for authenticated encryption.
AES Encryption Concepts
To encrypt data, enter the plain text or password and choose an appropriate AES mode of operation. Each mode offers different security and performance characteristics.
AES Modes of Operation Comparison
| Mode | IV Required by This Tool | Padding | Authentication | Status |
|---|---|---|---|---|
| ECB | No | PKCS5 | No | Not Recommended |
| CBC | Yes (16 bytes) | PKCS5 | No (add MAC) | Acceptable |
| CTR | Yes (16 bytes) | None | No (add MAC) | Good |
| GCM | Yes (16 bytes) | None | Yes (built-in) | Recommended |
ECB (Electronic Codebook) does not use an IV and produces identical ciphertext for identical plaintext blocks, making it insecure for real-world usage. CBC (Cipher Block Chaining) uses an Initialization Vector (IV) to randomize output - more secure than ECB but does not provide authentication. CTR (Counter Mode) turns AES into a stream cipher and allows parallel processing, making it suitable for high-performance systems. GCM (Galois/Counter Mode) provides authenticated encryption, ensuring confidentiality and integrity - the recommended mode for modern applications and APIs.
Padding
ECB and CBC require input in complete 16-byte blocks. PKCS5Padding adds padding, including a full padding block when input is already aligned. Use NoPadding only when input is already a multiple of 16 bytes. CTR and GCM use NoPadding and accept other input lengths.
AES Key Size and IV
AES always uses a 128-bit block size. This tool requires 16-byte (128-bit) IVs for CBC, CTR, and GCM. CBC uses a 16-byte IV; CTR uses a 16-byte initial counter block whose counter sequence must not repeat under the same key. GCM supports other nonce lengths, with 12 bytes (96 bits) recommended by NIST; this tool currently accepts 16 bytes. ECB does not use an IV. Secret key sizes must be 16, 24, or 32 bytes for AES-128, AES-192, and AES-256 respectively.
Encrypted output is Base64 encoded by default, with an option to export ciphertext in HEX format.
Common AES Encryption & Decryption Errors (and Fixes)
Fix: Use AES-GCM for authenticated encryption, or AES-CBC with a secure MAC if GCM is unavailable.
Fix: For encryption, enter a fresh 16-byte IV or use Generate IV. For decryption, use the original IV and its encoding.
Fix: Ensure the same key, IV, and associated data are used for both encryption and decryption.
Fix: Ensure the same padding scheme is used on both sides. Switch to AES-GCM to avoid padding-based modes entirely.
Secret Key Format
- Secret Key must be provided in one of these formats: Hex / Base64 / Plain Text.
- Key length must match the selected key size:
- 128-bit → 16 bytes (e.g.
32 hex characters) - 192-bit → 24 bytes
- 256-bit → 32 bytes
- 128-bit → 16 bytes (e.g.
- Example:
32 hex chars = 16 bytes (AES-128)
Using a plain-text password directly as an encryption key is not recommended. Human-readable passwords usually have low entropy and are vulnerable to brute-force and dictionary attacks.
For stronger security, derive a key from your password using PBKDF2 with a unique salt and an appropriate iteration count. Its output length is configurable: use 16, 24, or 32 bytes for AES-128, AES-192, or AES-256. Key strength still depends on the password and derivation settings. Use the PBKDF2 Hashing Online Tool to generate one.
IV Format and Security Concerns
- IV can be Hex / Base64 / Plain Text.
- In this tool, the IV must decode to exactly 16 bytes (128 bits):
- 32 hex characters
- or a Base64 string that decodes to 16 bytes
- or 16 plain text bytes
- IV is required for CBC, CTR, and GCM. Supply a random IV explicitly or use Generate IV.
- If the IV is missing, this tool rejects CBC, CTR, and GCM requests. Enter an IV or click Generate IV before encryption, and retain it for decryption.
- Without a random IV, identical plaintext encrypted with the same key produces identical ciphertext - this leaks information and weakens security.
- Best practice: always use a random IV for CBC/CFB/GCM modes and never reuse an IV with the same key.
You can analyze insecure AES usage using our Crypto Safety Validator.
Secure Usage Guidelines for AES
- Prefer AES-GCM for modern applications - it provides encryption and authentication in one operation
- Never use AES-ECB for real data - it reveals patterns in identical plaintext blocks
- Always use a random, unique IV for every encryption operation
- Never reuse encryption keys or IVs across different systems or purposes
- Use AES only for data encryption - not for password storage; use bcrypt, scrypt, or Argon2 instead
Security note: AES-GCM provides confidentiality and integrity in one pass. CBC and CTR modes require additional authentication (MAC) to prevent tampering.
MAC Generators: HMAC Generator · Poly1305 Generator
AES vs RSA vs DES
AES is a symmetric encryption algorithm designed for speed and efficiency. RSA is an asymmetric algorithm mainly used for secure key exchange and digital signatures, while DES is an outdated symmetric cipher and is no longer considered secure.
| Feature | AES | RSA | DES |
|---|---|---|---|
| Encryption Type | Symmetric | Asymmetric | Symmetric |
| Performance | Very fast | Slow | Fast but insecure |
| Key Size | 128 / 192 / 256 bits | 2048+ bits | 56 bits |
| Security Status | Highly secure | Secure | Broken / deprecated |
| Typical Usage | Encrypting data | Key exchange | Legacy systems |
In practice, AES is often used together with RSA encryption, where RSA secures the AES secret key and AES encrypts the actual data.
When NOT to Use AES
- Password Storage: AES is reversible encryption and should never be used to store passwords. Use bcrypt, scrypt, or Argon2 instead.
- Unauthenticated Encryption: Using ECB or CBC without integrity protection can allow data tampering. Prefer AES-GCM or MAC-based solutions like Poly1305.
- Poor Key Management: Hardcoded keys, reused IVs, or weak randomness can compromise AES security entirely.
- Public-Key Requirements: AES is not suitable for digital signatures or secure key exchange. Use RSA or elliptic-curve cryptography for these use cases.
Applications of AES Encryption
- Data Protection: Encrypting sensitive files and database fields.
- Secure Communication: HTTPS, SSL/TLS, and API payload encryption.
- Authenticated Encryption: Used with MACs such as Poly1305 to ensure integrity.
Frequently Asked Questions (FAQ)
❤️ Liked this tool?
If it saved you time, consider buying me a coffee to support future improvements.