Skip to main content
AllDevToolsHub
🔐

AES Encrypt / Decrypt

100% Local

Encrypt and decrypt text with AES-256-GCM and PBKDF2 key derivation, 100% client-side.

AES Encrypt / Decrypt
AES-256-GCM authenticated encryption with PBKDF2 (100,000 iterations). 100% client-side in your browser RAM.
Ctrl+Enter to run
Try:
This tool runs entirely in your browser. Your input is never uploaded, logged, or sent to AllDevToolsHub or anyone else, and it keeps working offline once the page has loaded.

Enter text to encrypt with AES-256-GCM. Set the key and IV, or let the tool generate them.

Overview

What is AES Encrypt / Decrypt?

Encrypt text with AES-256-GCM using PBKDF2 (100k iterations, SHA-256). Salt and IV packed in base64 output. Fully client-side, no server uploads.
FAQ

Frequently Asked Questions

Reference

Technical Deep Dive

AES Encrypt / Decrypt

Protect sensitive text with AES-256-GCM encryption derived from a password via PBKDF2 (100,000 iterations, SHA-256). The salt and IV are packed into the base64 output so decryption only needs the ciphertext and password. Includes a random password generator and encryption metadata display. All processing is fully client-side.

The failure this tool prevents is pasting a production secret into a server-side “encrypt” box. AES-256-GCM here runs in Web Crypto. The password, derived key, and plaintext stay in this tab.

A typical payload is a Slack-bound API key: encrypt sk_live_… with a 16+ character passphrase spoken on a different channel. The Base64 blob is [16B salt][12B IV][ciphertext][16B tag].

Decrypting a flipped bit fails the GCM tag instead of returning garbage. If you need key rotation or audit logs, use a KMS, not this page.

01 Understanding GCM vs. Legacy Modes

Mode Type Integrity Check Security Profile
ECB Block None Insecure, patterns leak
CBC Chained Needs HMAC Vulnerable to Padding Oracle
GCM Stream/Auth Built-in Tag Modern Standard

02 Key Derivation via PBKDF2

A common mistake is using a password directly as an encryption key. Passwords lack the entropy required for AES. We use PBKDF2-SHA256 with 100,000 iterations to stretch your password into a cryptographically strong 256-bit key.

  • 🛡️
    16-Byte Random Salt Prevents rainbow table attacks by ensuring every derived key is unique, even with identical passwords.
  • 🔄
    100,000 Iterations Makes brute-force attacks computationally expensive, requiring significant hardware resources per guess.

The Encrypted Output Structure

This tool packs everything into a single Base64 string for easy transmission. The receiver extracts the following components:

First 16B
SALT
Next 12B
IV
Variable
DATA
Last 16B
TAG

03 When You Should, and Shouldn't, Reach for This

Browser AES is the right tool for a narrow slice of crypto problems. Knowing the slice avoids both reinventing key management and pasting plaintext into the wrong solution:

  • Encrypting a short snippet to share over chat A staging-environment credential someone needs by tomorrow morning. Encrypt with a one-time password, send the ciphertext through Slack/email, share the password through a separate channel (signal, voice). Recipient decrypts with the same tool.
  • Adding a passphrase layer to an exported config You're exporting a Postman collection or .env snapshot for a contractor. Encrypt the file's contents first; their decryption still happens in a browser they trust.
  • Teaching authenticated encryption A live demo, change one character of the ciphertext, watch the GCM auth tag reject it on decryption. Easier to internalize than reading the spec.
  • Production secrets at scale Use a KMS (AWS KMS, GCP Cloud KMS, Vault). They keep the master key in HSM-backed storage, audit every use, support rotation without re-encrypting data, and let you scope access via IAM. Passwords are a fundamentally weaker root-of-trust than HSMs.
  • End-to-end encrypted messaging Use Signal Protocol or libsignal. You need forward secrecy (a stolen key can't decrypt past messages), break-in recovery, asynchronous delivery, multi-device, none of which raw AES-GCM provides.

04 Worked Examples

EXAMPLE 1 · ROUND-TRIP A STAGING TOKEN
Plaintext:
STAGING_API_KEY=sk_live_b7d2c8a1...
Password (from password manager):
9!kVz3qP-tL4mWn8
Ciphertext (Base64, salt+iv+data+tag packed):
jK3vP9aF2sLqB7nE…dQ8mY1uG6oA4xR0z==

Send ciphertext over Slack; deliver the password through a separate channel. Even if Slack's transport is compromised, the channel separation prevents both halves leaking together.

EXAMPLE 2 · THE AUTH TAG IN ACTION
Tamper: flip a single character in the ciphertext middle.
jK3vP9aF2sLqB7nE…XQ8mY1uG6oA4xR0z==
                            ↑ changed
Decryption result:
OperationError: The operation failed for an

operation-specific reason


GCM rejects the entire message, you do not get a partial plaintext. This is the difference between GCM and CBC: with CBC + no HMAC, a flipped bit silently corrupts the plaintext, opening the door to padding-oracle attacks. GCM's all-or-nothing semantics prevent the entire class of failure.


EXAMPLE 3 · WHY OPENSSL enc DOES NOT SUPPORT GCM

OpenSSL's enc command does not support authenticated encryption modes like GCM. Attempting openssl enc -aes-256-gcm will fail. This is a common pitfall, many online tutorials show this command, but it is incorrect.

$ openssl enc -aes-256-gcm -pbkdf2 -iter 100000   -salt -in plain.txt -out cipher.bin

Cipher not supported.


OpenSSL supports AES-GCM through the EVP API or cms command, but not through enc. For CLI-based AES-GCM encryption, use a scripting language with proper GCM support:


# Node.js example using the same Web Crypto primitives:
node -e "
const crypto = require('crypto');
const cipher = crypto.createCipheriv('aes-256-gcm', key, iv);
const ct = cipher.update(plaintext, 'utf8', 'hex');
cipher.final();
console.log(ct + ':' + cipher.getAuthTag().toString('hex'));
"

This tool's output format (salt+IV+ciphertext+tag packed in Base64) is browser-specific. For production CLI workflows, use a KMS or a scripting language with native GCM support.




05 Related Tools

Encryption is rarely a single step. The companions below cover the password the cipher depends on, the key formats around it, and the storage layer past it:

You Might Also Need