AES Encryption Tool

Encrypt and decrypt text with AES-256-GCM in your browser, with the key derived locally from a passphrase.

  • Runs locally in your browser
  • No upload required

Try it

Stretched with PBKDF2-HMAC-SHA-256. Prefer a long, random passphrase.

When set, the passphrase is ignored and this 32-byte key is used directly.

Mode
encrypt
Cipher
AES-256-GCM
Key source
PBKDF2-HMAC-SHA-256
Iterations
1,000
Salt (base64)
c2FsdHktc2FsdHktc2E=
IV (hex)
0f0e0d0c0b0a090807060504
Ciphertext + tag (base64)
VPJiakupazicRpKK1fXYRg==

Supported formats

Input
text, select, number
Output
text, boolean

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Encrypted the text with AES-256-GCM (raw key).

How it works

  • Used the supplied 32-byte key.
  • Generated a 12-byte nonce (or used the supplied IV).
  • Encrypted the UTF-8 plaintext with AES-256-GCM, producing ciphertext and a 16-byte tag.
  • Encoded the ciphertext and tag together as base64 and reported the salt and IV.
  • GCM is authenticated encryption: a wrong key, salt, IV or a modified ciphertext fails closed.
  • The passphrase, key and plaintext stay in your browser and are never sent or stored.

Methodology

  1. Derive a 256-bit key either from a raw 32-byte key or by stretching the passphrase with PBKDF2-HMAC-SHA-256 (RFC 8018) and a random salt.
  2. Generate a fresh 12-byte nonce per message; a 96-bit nonce is the recommended GCM size.
  3. Encrypt with AES-256-GCM per FIPS 197 and NIST SP 800-38D, producing ciphertext and a 128-bit authentication tag.
  4. On decryption, recompute the tag and compare before returning any plaintext, so tampering fails closed.
  5. Prefer the platform Web Crypto implementation in the browser; the bundled core matches the NIST vectors and is the deterministic fallback.

Usage

  1. Choose encrypt or decrypt.
  2. Enter a passphrase (and, for decryption, the salt and IV the sender provides) or a raw 32-byte key in hex.
  3. Run the tool and copy the base64 ciphertext plus the IV and salt; the recipient needs all three.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Encrypt with a raw AES-256 key

jsonSelect to copy
{
  "mode": "encrypt",
  "plaintext": "attack at dawn",
  "keyHex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
  "ivHex": "000102030405060708090a0b"
}

Decrypt that message

jsonSelect to copy
{
  "mode": "decrypt",
  "ciphertext": "JnaieqaO4nr5YfPqxodKZF6OIKVODqOj4nIkfxKE",
  "keyHex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
  "ivHex": "000102030405060708090a0b"
}

Encrypt with a passphrase (reproducible)

jsonSelect to copy
{
  "mode": "encrypt",
  "plaintext": "secret note",
  "passphrase": "correct horse battery staple",
  "saltBase64": "c2FsdHktc2FsdHktc2E=",
  "ivHex": "0f0e0d0c0b0a090807060504",
  "iterations": 1000
}

Limitations

Authenticated encryption matters

AES-GCM combines confidentiality with a tag that detects tampering. That is why a wrong key, a changed ciphertext or a reused IV fails closed instead of returning plausible garbage. Use an authenticated mode rather than AES-CBC plus a separate hash.

The one rule that must never be broken is nonce uniqueness: never reuse an IV with the same key. This tool generates a fresh IV for every interactive encryption and exposes the IV only so a recipient can decrypt.

What this tool will not do

It is not a file vault, a key manager or a secure messenger. It encrypts text you paste and hands back a value you must store safely; key management, transport security and endpoint trust remain yours.

Frequently asked questions

Which key derivation and cipher are used?
A passphrase is stretched with PBKDF2-HMAC-SHA-256 and a random salt; the message is encrypted with AES-256-GCM, an authenticated cipher from NIST SP 800-38D. The interactive tool uses the browser's Web Crypto API where available.
What do I need to send to the recipient?
The base64 ciphertext (which includes the authentication tag), the IV and, when a passphrase is used, the salt and iteration count. All of them are non-secret except the passphrase; send the passphrase over a separate channel.
Is the Web Crypto path different from the bundled one?
No. The bundled AES-GCM core is verified against the NIST SP 800-38D known-answer vectors and produces byte-for-byte identical output to `crypto.subtle`; the tests assert they agree.

Sources

  1. FIPS 197: Advanced Encryption Standard (AES) — NIST
  2. NIST SP 800-38D: Recommendation for Block Cipher Modes of Operation — GCM — NIST
  3. RFC 8018: PKCS #5 — Password-Based Cryptography Specification v2.1 — IETF
  4. MDN Web Docs — SubtleCrypto.encrypt() — MDN