AES Encryption & Decryption
This tool encrypts and decrypts text using AES-256-GCM, deriving the key from your passphrase with PBKDF2 over 250,000 iterations of SHA-256. A fresh random salt and initialisation vector are generated on every encryption and stored at the front of the output, which is why encrypting the same text twice produces different results — that is correct and necessary behaviour rather than a fault. GCM is an authenticated cipher, so decryption verifies the message has not been altered as well as decrypting it, and a wrong passphrase and a tampered message fail the same check. The primitives are your browser own, and nothing is transmitted.
How it works
Encrypts text with AES-256-GCM, deriving the key from your passphrase using PBKDF2 with 250,000 iterations of SHA-256. A fresh random salt and IV are generated every time and stored at the front of the output, which is why encrypting the same text twice gives different results — that is correct behaviour, not a bug.
GCM is an authenticated cipher, so decryption verifies the message has not been altered as well as decrypting it. A wrong passphrase and a tampered message both fail the same check, and the tool cannot tell you which it was.
Everything runs in your browser using its own cryptography — nothing is sent to a server.
This uses real, audited primitives from your browser, and the strength of the result comes down almost entirely to your passphrase — a short one can be brute-forced regardless of the cipher. For anything that genuinely matters, use a tool built for the job with proper key management rather than a web page.
What the output actually contains
The base64 output is three things joined together:
- 16 bytes of salt — random, used to derive the key from your passphrase.
- 12 bytes of IV — random, used by the cipher.
- The ciphertext and its authentication tag.
Neither the salt nor the IV is secret; both must be known to decrypt, which is why they travel with the message. What must stay secret is the passphrase.
Why 250,000 iterations
PBKDF2 exists to make guessing passphrases expensive. Each guess costs an attacker the same 250,000 hashes it costs you once, so a large iteration count multiplies the cost of a brute-force attack while adding a barely perceptible delay to legitimate use.
The honest limits
The cipher is not the weak point. Your passphrase is. A six-character passphrase falls to a modern GPU quickly no matter what algorithm sits behind it, so use a long one — a passphrase of several unrelated words beats a short one full of symbols.
There is also no key management here: no way to rotate a key, no way to revoke access, no record of what was encrypted. For anything beyond ad hoc use, that matters more than the algorithm does.
Frequently asked questions
What encryption is used?
AES-256 in GCM mode, with the key derived from your passphrase using PBKDF2-SHA256 over 250,000 iterations. All of it comes from your browser own Web Crypto implementation.
Why is the output different every time?
Because a fresh random salt and IV are generated for each encryption. Reusing them would let an attacker spot that two ciphertexts encrypt the same message, so varying output is a requirement rather than a quirk.
What does authenticated encryption mean?
GCM produces an authentication tag alongside the ciphertext. Decryption checks it, so any alteration to the data is detected rather than silently producing garbage.
Why does it not say whether my passphrase was wrong?
Because it cannot tell. A wrong key and a tampered message both fail the same authentication check, and distinguishing them would leak information an attacker could use.
Is this safe for real secrets?
The primitives are sound and nothing is transmitted, but the strength comes down almost entirely to your passphrase — a short one is brute-forceable regardless of the cipher. For anything that genuinely matters, use a tool with proper key management rather than a web page.
Is my data sent anywhere?
No. Encryption and decryption happen entirely in your browser.
Related tools
HMAC Generator
This HMAC generator signs a message with a secret key, using SHA-1 through SHA-512.
All Hash Generator (MD, SHA, CRC & more)
This hash generator computes MD5, SHA-1/256/512, SHA-3, RIPEMD-160, Whirlpool, CRC32 and NTLM hashes from text, instantly in your browser.
Password Generator
This password generator creates strong, cryptographically random passwords with adjustable length and character sets, in your browser.