DevTools Logo

AES Encryption

AES Encryption & Decryption

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

This tool encrypts text with AES-256-GCM from the Web Crypto API. Your passphrase is stretched through PBKDF2 (SHA-256, 100,000 iterations, a fresh random salt), and the derived key encrypts the plaintext alongside a random 12-byte IV. The result is one Base64 string packing salt, IV, ciphertext and GCM authentication tag, in that order.

GCM is an authenticated mode: any change to the ciphertext, the IV, or the passphrase makes decryption fail outright instead of returning garbage — the practical difference from older CBC. Random salt and IV on every run mean encrypting the same text twice never repeats an output.

How to use this tool

  1. Enter text and passphrase

    Paste the plaintext you want to protect and pick a long, unpredictable passphrase.

  2. Encrypt

    Run the encryption and a Base64 blob appears in the output panel.

  3. Store the output

    Keep the ciphertext anywhere — it is worthless to anyone without the passphrase.

  4. Decrypt on demand

    Switch to decrypt, paste the Base64 string, enter the same passphrase, and confirm.

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.

AES-GCM versus AES-CBC

PropertyThis tool (GCM)
Tamper detectionBuilt in: a modified ciphertext fails the auth tag; CBC has no such check
IV12 random bytes generated fresh for every message
Key derivationPBKDF2-SHA-256, 100,000 iterations, 16-byte salt
Output formatBase64 of salt + IV + ciphertext with appended tag

The salt-IV-ciphertext layout is this tool's own container, not an OpenSSL format.

Common mistakes

Mistake:Expecting OpenSSL compatibility

Fix:openssl enc output stores its header and salt differently, so those blobs will not decrypt here.

Mistake:Reusing one passphrase everywhere

Fix:A leaked passphrase opens every ciphertext made with it, so derive one per purpose.

Frequently asked questions

Why is the AES output different every time?

Each run draws a new random salt and IV before deriving the key, so the same text and passphrase still produce fresh ciphertext. Decrypting any of those outputs with the original passphrase returns the identical message.

Can I decrypt text encrypted with another AES tool?

Only if it used this exact container: Base64 of salt, IV and GCM ciphertext. Output from OpenSSL, CryptoJS defaults, or CBC-mode tools arranges key material differently and gets rejected, so re-encrypt portable copies with this tool.

Is AES-256 stronger than AES-128?

Only in headroom — both are unbroken, and 128-bit keys already outrun any brute-force budget. Your passphrase is the weak link: PBKDF2 can stretch but not rescue a short password, so length and entropy beat the extra bits.

What happens if I forget the passphrase?

Decryption fails permanently. The AES key exists only at derive time from the passphrase and stored salt, and there is no recovery path — a failed attempt reports a wrong-key or corrupted-ciphertext error rather than partial output.

References & standards