AES Encryption & Decryption
AES-GCM encryption with PBKDF2 — your text and passphrase never leave your browser
Examples
Inspect the bundled payload layout
plaintext: hello world
passphrase: my-passAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAtNX3zp3Yxthw8/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
plaintext: hello world
passphrase: my-pass
[run Decrypt on the payload above]hello worldDecrypting the payload above with passphrase 'my-pass' reproduces the original plaintext, confirming the format is reversible when the passphrase matches.
Wrong passphrase fails closed
payload: AQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAtNX3zp3Yxthw8/Lc//+gbMO+krelesUhcJafw==
passphrase: wrongDecryption 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
Enter text and passphrase
Paste the plaintext you want to protect and pick a long, unpredictable passphrase.
Encrypt
Run the encryption and a Base64 blob appears in the output panel.
Store the output
Keep the ciphertext anywhere — it is worthless to anyone without the passphrase.
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
| Property | This tool (GCM) |
|---|---|
| Tamper detection | Built in: a modified ciphertext fails the auth tag; CBC has no such check |
| IV | 12 random bytes generated fresh for every message |
| Key derivation | PBKDF2-SHA-256, 100,000 iterations, 16-byte salt |
| Output format | Base64 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.
Related guides
Encryption Tools Explained: AES vs BCrypt vs HMAC
Three cryptographic primitives developers constantly confuse — reversible encryption (AES), password hashing (BCrypt), and message signing (HMAC). What each one is for, and how to pick correctly.
Generating Secure API Tokens and Secrets in the Browser
How to create cryptographically strong tokens, sign payloads with HMAC, and encrypt data with AES — all client-side, with nothing sent to a server.
References & standards
Related tools
Client-Side File Encryptor
Encrypt any file with AES-256-GCM and PBKDF2 directly in your browser — no uploads, no accounts, wrong passwords fail loudly.
Text Encryptor
Encrypt and decrypt text with a passphrase using AES-256-GCM and PBKDF2 key derivation — everything happens in your browser, nothing is uploaded or stored
Hash Generator
Generate multiple cryptographic hashes with comprehensive analysis, security information, file upload, and multiple output formats
Password Generator
Generate secure passwords with customizable options including length, character sets, and complexity requirements