aes

AES-GCM Encrypt / Decrypt

Encrypt or decrypt text with AES-256-GCM using your own key, or auto-decrypt JSON values.

Set your key in Key & IV. Auto mode decrypts JSON values in place, or processes one value per line.

Input
Cipher text (hex)

Encrypted hex appears here

Common questions

Is my key or text sent to a server?

No. The key, the IV, and the text are processed entirely in your browser with the built-in Web Crypto API, so none of them ever leave your device. The key is also never stored; it lives only in the field while the page is open.

What algorithm and key does this use?

AES-256-GCM. Your secret is hashed with SHA-256 to produce the 32-byte (256-bit) key, the IV is read from the hex you enter, there is no additional authenticated data, and the authentication tag is 128 bits. This mirrors the common PHP AESGCM helper that derives its key the same way.

What is the format of the encrypted output?

Lowercase hex of the ciphertext with the 16-byte tag appended to the end, which is the same as PHP's bin2hex(ciphertext . tag). To decrypt, paste that exact hex back in; the last 16 bytes are treated as the tag.

What IV should I use, and how long?

GCM needs an IV (nonce), entered here as hex. Twelve bytes, written as 24 hex characters, is the standard length. Encryption and decryption must use the same IV, and you should never reuse an IV with the same key, since that breaks the security of GCM.

Why does decryption fail or say it could not process?

GCM verifies the tag, so a wrong key, a wrong IV, or ciphertext that was altered or truncated fails authentication instead of returning scrambled text. Check that the key and IV match the ones used to encrypt, and that the input is the untouched hex from encryption.

Will this match the output from my server or PHP code?

Yes, as long as the secret, the IV, and the text are identical. Web Crypto appends the tag after the ciphertext in the same order PHP does, so the hex is byte-for-byte compatible and each side can decrypt what the other produced.

Can I encrypt or decrypt many values at once?

Yes. Put one value per line and every line is converted on its own with the same key and IV, so the output lines up row for row with the input. Blank lines are kept to preserve that alignment, and a line that cannot be decrypted is flagged on its own row without stopping the others. Copy takes the whole result at once.

What does Auto mode do?

It reads the input and picks the action for you. Something that starts with { or [ is treated as JSON and its values are decrypted, input that is all long hex is decrypted line by line, and anything else is encrypted line by line. A small label shows what it detected, and you can switch to Encrypt or Decrypt to force a direction.

Can it decrypt the values inside a JSON object?

Yes. In Auto mode, paste a JSON object or array and each string value is decrypted in place while the keys and structure stay exactly as they were. Any value that is not valid ciphertext for your key and IV is left as-is and its row is highlighted in red, the same way the diff checker marks a line, and the result stays valid JSON you can copy.

Can I save my key and IV so I do not retype them?

Yes, and you can save several. Open Key & IV, click Save current, give the config a name such as UAT or Production, and choose a passphrase: the passphrase is stretched with PBKDF2 and used to AES-GCM wrap that config's key and IV, so only the name and ciphertext are written to this browser, never the plain key or the passphrase. Saved configs appear in a dropdown, and Load fills the fields from the one you pick. After a passphrase is entered that config stays unlocked for 24 hours, kept as a non-extractable key in IndexedDB that scripts cannot read back and that expires on its own, so you are not asked again. Delete removes a config and its remembered key. Each config can have its own passphrase, a passphrase can never be recovered if forgotten, and anyone using this browser within the 24-hour window could decrypt, so avoid saving high-value production keys on a shared machine.