AES

AES-GCM TOOL

AES Encryption / Decryption

Encrypt and decrypt text locally with AES-GCM using the Web Crypto API.

The password is hashed with SHA-256 to create a 256-bit AES key
Key Handling
IV Settings
Enter plain text or AES ciphertext JSON and a password to get started.
Input2 lines · 84 characters
Output0 lines · 0 characters
Click Encrypt or Decrypt to see the result here
AES-GCMEncryption with integrity verification
Random IVA new 12-byte IV for each encryption
Local ProcessingYour text and password are never uploaded

How This AES-GCM Text Encryption Tool Works

Encrypt UTF-8 text with the browser’s Web Crypto API and decrypt the JSON result using the same secret and key mode. AES-GCM provides authenticated encryption: modified ciphertext or mismatched parameters cause decryption to fail.

How to Encrypt and Decrypt Text

  1. Enter your text and secret. Choose SHA-256 or Raw key mode.
  2. Keep automatic random IV enabled and select Encrypt.
  3. Save the complete output JSON, including its iv and ciphertext fields. Keep your secret separately.
  4. For decryption, paste that JSON into the input, enter the same secret, and manually select the original key mode before selecting Decrypt. The keyDerivation field does not automatically switch the interface’s mode.

Key Modes and IV Requirements

SHA-256 mode hashes the UTF-8 secret once to obtain a 256-bit AES key. It does not use a salt or a deliberately slow password derivation function such as PBKDF2. A weak password remains vulnerable to guessing; this mode is not a password vault design.

Raw mode imports the UTF-8 bytes of the secret directly as an AES key. The secret must occupy exactly 16, 24 or 32 bytes, corresponding to AES-128, AES-192 or AES-256. It is not interpreted as hexadecimal or Base64, and non-ASCII characters may occupy multiple bytes.

Automatic mode generates a random 12-byte IV for each encryption. A manual IV must decode from Base64 to exactly 12 bytes. Never reuse an IV with the same key. The IV is not secret and is stored with the ciphertext.

Output Format and Compatibility

The JSON contains algorithm (AES-GCM), keyDerivation (SHA-256 or Raw), iv (Base64) and ciphertext (Base64). Web Crypto appends the default 128-bit authentication tag to the encrypted bytes; this combined value is stored in ciphertext.

To decrypt elsewhere, use the same UTF-8 secret handling, key derivation, IV and 128-bit tag. No additional authenticated data (AAD) is supplied. Libraries that expect a separate tag must split the final 16 bytes from the decoded ciphertext. AES-CBC results and unrelated AES payload formats are not interchangeable with this JSON.

Round-Trip Example

Encrypt the text Hello with a secret of your choice, SHA-256 mode and automatic IV. Move the entire JSON output back to the input, retain the secret and SHA-256 mode, and decrypt. The result should be Hello. Repeating encryption normally produces different JSON because the IV is random.

Web Crypto requires a secure context such as HTTPS or localhost. The encryption code processes text locally; the website also loads third-party analytics and advertising scripts.

Frequently Asked Questions

Why does decryption fail with the right password?

Check the selected key mode as well as the password. Preserve the complete JSON, IV and ciphertext. Changed bytes, a missing authentication tag, or a payload from another AES format can also cause failure.

Can I recover a forgotten secret?

The tool has no recovery mechanism and does not include the secret in the output JSON. Retain the secret and complete payload if you need to decrypt later.

Can I encrypt files or supply AAD?

This interface encrypts text and does not expose file encryption or additional authenticated data. Use a tool designed for those requirements.

Technical References