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
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
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
- 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.
- Generate a fresh 12-byte nonce per message; a 96-bit nonce is the recommended GCM size.
- Encrypt with AES-256-GCM per FIPS 197 and NIST SP 800-38D, producing ciphertext and a 128-bit authentication tag.
- On decryption, recompute the tag and compare before returning any plaintext, so tampering fails closed.
- Prefer the platform Web Crypto implementation in the browser; the bundled core matches the NIST vectors and is the deterministic fallback.
Usage
- Choose encrypt or decrypt.
- Enter a passphrase (and, for decryption, the salt and IV the sender provides) or a raw 32-byte key in hex.
- 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
{
"mode": "encrypt",
"plaintext": "attack at dawn",
"keyHex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
"ivHex": "000102030405060708090a0b"
}Decrypt that message
{
"mode": "decrypt",
"ciphertext": "JnaieqaO4nr5YfPqxodKZF6OIKVODqOj4nIkfxKE",
"keyHex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
"ivHex": "000102030405060708090a0b"
}Encrypt with a passphrase (reproducible)
{
"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
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.