AES Encryption

AES-GCM encryption with PBKDF2 — your text and passphrase never leave your browser

Plaintext

Text to encrypt

Examples

Inspect the bundled payload layout

Input
plaintext: hello world
passphrase: my-pass
Output
AQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAtNX3zp3Yxthw8/Lc//+gbMO+krelesUhcJafw==

Layout is salt (16 bytes) + IV (12 bytes) + ciphertext + 16-byte GCM tag, all Base64-encoded. The leading salt and IV bytes are 0x01×16 and 0x02×12 here only because they were fixed to make this example reproducible — the real tool uses fresh random bytes each run, so the output changes every time even for identical input.

Round-trip the same passphrase

Input
plaintext: hello world
passphrase: my-pass
[run Decrypt on the payload above]
Output
hello world

Decrypting the payload above with passphrase 'my-pass' reproduces the original plaintext, confirming the format is reversible when the passphrase matches.

Wrong passphrase fails closed

Input
payload: AQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAtNX3zp3Yxthw8/Lc//+gbMO+krelesUhcJafw==
passphrase: wrong
Output
Decryption failed — wrong passphrase or corrupted ciphertext.

AES-GCM's authentication tag forces the decryption to throw when the key is wrong, instead of silently returning garbage — the tool surfaces that as a red error message.

About this tool

The AES Encryption tool encrypts and decrypts short text entirely in your browser using AES-GCM, the modern authenticated-encryption mode of the Advanced Encryption Standard. There is no configuration to learn: type the text, choose a passphrase, and click Encrypt to get a single Base64 payload that contains everything needed to decrypt it later.

Under the hood the tool runs the Web Crypto API. Your passphrase is first run through PBKDF2 with 100,000 iterations of SHA-256 and a freshly generated 16-byte salt, producing a 256-bit AES key. The text is then encrypted with AES-GCM using a fresh 12-byte IV, and the resulting ciphertext is appended with a 128-bit authentication tag — AES-GCM detects tampering by failing to decrypt when even a single byte has been altered.

The output Base64 string bundles the salt, IV, ciphertext and authentication tag in that order. Decryption splits the same Base64 back into its parts, re-derives the key from the passphrase and the stored salt, and verifies the authentication tag before returning the plaintext. Because the passphrase is never sent anywhere and the salt and IV are regenerated on every encryption, the same text with the same passphrase produces a different ciphertext every time.

How to use

  1. Pick a passphrase

    Use a long, high-entropy passphrase — the strength of the encryption depends entirely on its quality, not on the algorithm.

  2. Encrypt or decrypt

    Stay on Encrypt to turn plaintext into a Base64 payload, or switch to Decrypt to paste a previously generated payload and the same passphrase.

  3. Copy or paste the Base64 result

    Copy the Base64 output for safe storage or transit, or paste a Base64 payload into Decrypt with its passphrase to recover the original text.

  4. Read the error when something fails

    If decryption returns an error, the passphrase is wrong or the ciphertext has been altered — AES-GCM intentionally refuses to return anything rather than producing corrupted plaintext.

Use cases

Encrypting an API key or token before pasting it into a public file

Wrap secrets in an AES-GCM payload and commit the result with the passphrase kept elsewhere.

Exchanging short sensitive messages with a known recipient

Share the Base64 ciphertext over any channel — only the holder of the passphrase can read it.

Encrypting notes for personal storage

Keep a ciphertext in a notes file and recall it later by running the same passphrase through the Decrypt tab.

Demonstrating authenticated encryption

Show how GCM differs from older modes by altering one byte of a payload and watching decryption fail instead of returning corrupted text.

Common mistakes

Mistake:Treating the Base64 payload as encrypted with the passphrase alone.

Fix:The salt and IV are stored inside the payload and re-used on decryption, but the passphrase is never stored — losing it means the ciphertext is unrecoverable.

Mistake:Using a short, low-entropy passphrase.

Fix:PBKDF2 with 100k iterations slows brute force, but a guessable passphrase can still be cracked offline. Use a long passphrase or a random one stored in a password manager.

Mistake:Assuming two encryptions of the same text with the same passphrase will match.

Fix:Each call generates a fresh random 16-byte salt and 12-byte IV, so the output bytes are different every run — that is intentional and is what makes the encrypted text non-deterministic.

Mistake:Reusing this output as a password hash.

Fix:AES-GCM is a reversible cipher, not a one-way password hash. Use bcrypt or Argon2 for password storage; use this tool when you need to be able to decrypt the value later.

Frequently asked questions

References & standards