ToolMight LogoToolMight

AES Encryption & Decryption

Encrypt and decrypt text data using AES-128, AES-192, and AES-256 (CBC/GCM) completely in your browser.

Loading Tool...
Sponsored

Encrypt and decrypt text messages using secure AES-256 standard algorithms (GCM or CBC modes) entirely in your browser.

Learn About This Tool

Advanced Encryption Standard (AES) Explained

AES (Advanced Encryption Standard) is a symmetric block cipher standard adopted worldwide to protect sensitive data. It uses cryptographic key lengths of 128, 192, or 256 bits. Symmetric encryption means that the exact same key or passphrase is required to both encrypt and decrypt the payload.
  • AES-256 GCM mode is recommended as it provides authenticated encryption
  • AES-256 CBC mode uses cipher block chaining with initialization vectors
  • Protects database entries, credential logs, or communication packages
  • Requires secure key distribution so recipients can read messages

Understanding AES-GCM vs AES-CBC Modes

AES-GCM (Galois/Counter Mode) provides both confidentiality and data integrity checks. If ciphertext characters are modified, decryption fails immediately.AES-CBC (Cipher Block Chaining) only provides confidentiality. It requires a unique Initialization Vector (IV) for each execution to prevent identical plaintexts from producing identical ciphertexts.
  • GCM prevents bit-flipping attacks by verifying payload integrity signatures
  • CBC is a legacy cipher mode that requires padding for block alignments
  • Both modes utilize cryptographically secure key derivations
  • A unique IV is generated automatically for each encryption request

Web Cryptography API for Local Cipher Operations

This tool uses the browser's native Web Cryptography API (window.crypto.subtle). Key derivation from your passphrase uses PBKDF2 with 100,000 iterations of SHA-256 (for hashing, check out our Hash Generator). All cipher calculations occur entirely on your local machine. The resulting bundle combines the salt, initialization vector, and ciphertext encoded into Base64 or Hex (which can be inspected via our Base64 Encoder / Decoder):
// Structure of the output bundle:
// [Derived Salt (16 bytes)][IV (12 or 16 bytes)][Encrypted Ciphertext]

// Example Base64 format:
U2FsdGVkX1948293ad...
  • Passphrases are never sent over HTTP requests or server connections
  • PBKDF2 key derivation makes brute-forcing passphrases computationally difficult
  • Combined outputs bundle the derived salt, IV, and cipher text for compatibility
  • Encrypted messages can be outputted in Hexadecimal or Base64 formats

How to Use AES Encryption & Decryption

1

Choose Mode & Enter Passphrase

Select Encrypt or Decrypt mode, and type a secure key passphrase in the input field.

2

Input Target Payload

Paste your plaintext message to encrypt, or paste the Base64/Hex ciphertext to decrypt.

3

Process and Export

Click the Process button to run the cipher. Copy the result using the Copy button.

Sponsored

Common questions

Is symmetric encryption secure?

Yes. AES-256 is the cryptographic standard approved for government and military use. Its security depends entirely on keeping the passphrase secret.

What is an Initialization Vector (IV)?

An IV is a random block of data used to initialize the encryption algorithm. It ensures that encrypting the same text twice with the same key produces different ciphertexts, preventing pattern analysis.

How does the tool bundle the salt and IV?

To ensure that you can decrypt the message later, the tool prefixes the ciphertext with the randomly generated Salt (16 bytes) and IV (12 or 16 bytes). The combined string is then encoded in Base64 or Hex.

Why does decryption fail with the correct passphrase?

Ensure that the Algorithm Mode (GCM vs CBC) and Output Format (Base64 vs Hex) match the exact settings used during encryption. Any variation will cause decryption to fail.

What is PBKDF2?

PBKDF2 (Password-Based Key Derivation Function 2) is an algorithm that applies a cryptographic hash function repeatedly to derive a secure binary key from a text passphrase, protecting against rainbow table attacks.

Are my secrets transmitted to any server?

No. The tool uses standard Web Crypto APIs built into modern browsers. All cryptographic processing occurs locally on your machine.

What is the difference between AES-128, AES-192, and AES-256?

AES-256 uses a 256-bit key length, making it much more computationally secure against brute-force attacks than AES-128 and AES-192, though it is slightly slower to process.

Why is GCM mode preferred over CBC mode?

GCM is an Authenticated Encryption with Associated Data (AEAD) mode. It provides both confidentiality and authentication (verifying that the data hasn't been tampered with), whereas CBC only provides confidentiality and is susceptible to padding oracle attacks if not paired with a MAC.

Can I decrypt a message if I lose my passphrase?

No. AES is a mathematically secure encryption standard with no backdoors. If you lose the passphrase, there is no way to recover or decrypt the original plaintext data.

Is there a limit to the size of the text I can encrypt?

While the Web Crypto API can handle very large strings, encrypting extremely large payloads (hundreds of megabytes) directly in the browser may consume significant memory. It is ideal for text strings, API keys, credentials, and configuration payloads.

Related tools