How to use
- Choose Encrypt above, enter the text and a password, then press Encrypt. When the page first opens, the sample text is already encrypted.
- Copy the resulting
aesgcm.v1.…string to keep or share. That one string carries the key size, iteration count, salt, IV and ciphertext, so the password is all you need to open it. - To open it, switch to Decrypt, paste the string and enter the same password. The ciphertext you just made can be filled in with Use the ciphertext just made.
- If the password is wrong, or even one character of the ciphertext changed, decryption is refused. Not saying which of the two is the problem is correct behaviour.
Algorithm and parameters
| Item | Value | Why |
|---|---|---|
| Cipher | AES-GCM, 256-bit key (128-bit selectable) | Encrypts and checks for tampering (authentication) in one step. |
| Key derivation | PBKDF2-HMAC-SHA-256, 600,000 iterations (1,000,000 selectable) | Slows brute force when turning a password into a key. 600,000 is the OWASP recommendation for this combination. |
| salt | 16 random bytes, fresh every time | The same password yields a different key each time. |
| IV (nonce) | 12 random bytes, fresh every time | Reusing an IV under the same key breaks GCM, so it changes on every run. |
| Auth tag | 16 bytes (128 bits) | Detects whether the ciphertext was altered. |
| Additional authenticated data | none | |
| Plaintext and password | UTF-8, password NFC-normalized | Prevents a password from differing between macOS and Windows keyboards for Korean and accented text. |
Modes that leave patterns such as ECB, and modes without authentication, are not offered. Iteration counts below 100,000 are rejected.
Decrypting elsewhere
Split the result on . and you get aesgcm, v1, key size, iterations, salt, IV, ciphertext plus tag, in that order. The last three parts are base64url, and the final 16 bytes of the ciphertext part are the authentication tag. In Node.js it opens like this. It is the code used to confirm that this tool’s output decrypts to the original text.
const crypto = require('node:crypto');
const [, , bits, iter, s, i, c] = packed.split('.');
const b = (x) => Buffer.from(x, 'base64url');
const key = crypto.pbkdf2Sync(password.normalize('NFC'), b(s), +iter, +bits / 8, 'sha256');
const sealed = b(c);
const d = crypto.createDecipheriv(`aes-${bits}-gcm`, key, b(i));
d.setAuthTag(sealed.subarray(-16));
const text = Buffer.concat([d.update(sealed.subarray(0, -16)), d.final()]).toString('utf8');
The ciphertext is as long as the plaintext in bytes, with the 16-byte tag added. For example “hello” (5 bytes) becomes 5 bytes of ciphertext plus a 16-byte tag, 21 bytes in total.
Things to watch
- A lost password cannot be recovered. No copy exists anywhere.
- A warning appears when the password is shorter than 12 characters. Even with PBKDF2, someone holding the ciphertext can guess a short password, so a long, unpredictable passphrase is safer. Use the Password Generator.
- The ciphertext length reveals the plaintext length. If the length itself is secret, pad the text to a fixed size first.
- This tool is for text. To verify passwords on a server, use a password hash (bcrypt, Argon2), not encryption.
FAQ
Are my text and password sent to a server?
No. Everything is computed on this device with the browser’s Web Crypto API and nothing is transmitted or stored. It also works offline.
AES-128 or AES-256?
Neither is broken by any known attack. Use AES-256 unless you have a specific reason. The strength of the result depends more on the password than on the key size.
How does GCM differ from CBC or ECB?
GCM produces an authentication tag alongside the encryption, so any change to the ciphertext makes decryption fail. CBC has no such check, and ECB turns equal plaintext blocks into equal ciphertext blocks, exposing patterns, so this tool offers GCM only.
Why does the same text give a different result every time?
That is expected. Each run uses a fresh random salt and IV, and any of the results decrypts to the same text with the same password.
Can it decrypt AES output from other sites?
It reads only the aesgcm.v1. format it produces. Other tools place the salt differently or derive keys another way, so they are often incompatible. The parameters and code above let you match them by hand.
Related tools
- To check only that data was not changed, use the Hash Generator, and to sign with a secret key use the HMAC Generator.
- For asymmetric encryption with key pairs, start with the RSA Key Generator.
- For the encoding used to carry ciphertext as text, see the Base64 Encoder and Decoder.
The text and password you enter are processed only in your browser and never sent to a server.