AES Encrypt / Decrypt

Encrypt and decrypt text using AES (Advanced Encryption Standard)

Enter text to encrypt...
Loading editor...

AES Encryption & Decryption — AES-256 Online Cipher Tool

Understanding the Basics

AES (Advanced Encryption Standard) is a symmetric block cipher standardized by NIST in 2001 (FIPS 197) after a global competition that selected the Rijndael algorithm submitted by Joan Daemen and Vincent Rijmen. "Symmetric" means the same key is used for both encryption and decryption, distinguishing it from asymmetric cryptography like RSA where separate public and private keys are used. AES operates on fixed 128-bit (16-byte) blocks of data using substitution-permutation rounds: 10 rounds for AES-128 (128-bit key), 12 rounds for AES-192, and 14 rounds for AES-256. AES-256 is considered quantum-resistant against Grover's algorithm (which would effectively halve the key strength to 128 bits — still computationally secure). The encryption mode determines how multiple blocks are chained: CBC (Cipher Block Chaining) XORs each plaintext block with the previous ciphertext block using a random Initialization Vector (IV), preventing identical plaintext blocks from producing identical ciphertext. GCM (Galois/Counter Mode) is an authenticated encryption mode that simultaneously encrypts and computes a Message Authentication Code (MAC), providing both confidentiality and integrity verification. Our tool uses the browser's native Web Crypto API for AES-CBC and AES-GCM encryption, ensuring hardware-accelerated, audited cryptographic operations.

How to Use the Tool

  1. Select the operation: "Encrypt" or "Decrypt".
  2. Enter the key: a 16-character string for AES-128, 24-character for AES-192, or 32-character for AES-256. The key is hashed to the correct byte length.
  3. Choose the mode: AES-CBC (standard) or AES-GCM (authenticated — also verifies integrity on decrypt).
  4. For encryption, paste your plaintext. For decryption, paste the Base64-encoded ciphertext from a previous encryption.
  5. Click "Encrypt" or "Decrypt" — the result appears in the output panel as Base64-encoded ciphertext or recovered plaintext.

Key Features & Specifications

  • AES-128, AES-192, and AES-256 encryption using the browser's Web Crypto API
  • Supports CBC (Cipher Block Chaining) and GCM (Galois/Counter Mode with authentication) modes
  • Random IV generated per encryption to ensure identical plaintexts produce different ciphertexts
  • AES-GCM mode provides authenticated encryption — decryption fails if ciphertext was tampered with
  • 100% browser-side encryption using native WebCrypto — plaintext never transmitted

Frequently Asked Questions (FAQ)

Q:What is the difference between AES-CBC and AES-GCM?
AES-CBC provides confidentiality only — it encrypts data but does not detect if the ciphertext has been tampered with. AES-GCM provides authenticated encryption: it generates a Message Authentication Code (MAC/tag) alongside the ciphertext, and decryption automatically verifies integrity — if the ciphertext or tag was modified, decryption fails with an authentication error.
Q:What is an Initialization Vector (IV) and why is it important?
An IV is a random value used to initialize the cipher for each encryption operation, ensuring that encrypting the same plaintext twice with the same key produces different ciphertext each time. Without a random IV, identical messages would produce identical ciphertext, leaking the fact that the same message was sent twice (and enabling pattern analysis). IVs are not secret — they are transmitted alongside the ciphertext.
Q:Is it safe to use this tool for encrypting sensitive production data?
This tool is designed for learning and testing AES encryption mechanics. For production systems, always use established encryption libraries (e.g., libsodium, TLS, age) with proper key management, key derivation functions (PBKDF2, Argon2), and authenticated modes. Never hardcode keys in application code.