فارسی

Encrypt and Decrypt Text with AES-GCM

Encrypt text with a passphrase and decrypt it here with AES-GCM. Everything runs in your browser; neither the text nor the password is sent anywhere.

Use this tool in your browser without installing software.

About this tool

This tool encrypts text with AES-GCM, the authenticated cipher used by browsers and established libraries. Your passphrase is turned into a 256-bit key with PBKDF2-SHA256 and 600,000 iterations, together with a random 16-byte salt and a random 12-byte IV. The result is a short, copyable string that starts with TENC1 and carries the iteration count, salt, IV, and ciphertext; that single string is all you need to decrypt, with no separate file or format. Because AES-GCM authenticates as well as encrypts, a wrong passphrase or even a one-character change in the output makes decryption fail with a clear error. Nothing about the text or the passphrase is sent to a server; all the work happens in your browser. The passphrase is not stored in the output, so losing it means the text cannot be recovered; keep it somewhere safe. For sensitive text, use a long and unique passphrase.

How to use it

  1. 1

    Put the text in the box and enter a long, unique passphrase.

  2. 2

    Press Encrypt and copy the output string that starts with TENC1.

  3. 3

    To restore the text, open the Decrypt tab, paste the same string and passphrase, then press Decrypt.

If the answer looks wrong

  • I am sure the password is right, but it fails.

    Check the keyboard layout, letter case, and spaces. Copy and paste the passphrase directly and make sure there is no leading or trailing space. One different character changes the key.

  • I get "not in the TENC1 format".

    The string must be complete and in one piece. Some chat apps wrap long lines; the tool ignores spaces and line breaks, but it cannot recover a missing chunk. Use the copy button in the tool.

  • Encryption takes a moment; is that normal?

    Yes. To make the passphrase harder to guess, 600,000 PBKDF2 rounds run before the key is ready. The short delay is intentional and is more noticeable on older devices.

  • Can the encrypted text be opened in another app?

    This format belongs to this tool. If you need to decrypt elsewhere, use an open standard and that app's own tool; AES-GCM and PBKDF2 are standard, but the string layout is specific to this page.

Frequently asked questions

Can I recover the text if I forget the passphrase?

No. The passphrase is not stored in the output; the key is derived from it. Without the right passphrase decryption cannot succeed and there is no bypass, so keep the passphrase somewhere safe.

What do the parts of the output mean?

The string starts with TENC1, then comes the PBKDF2 iteration count, the salt, the IV, and the ciphertext. The salt and IV are random and change on every encryption, which is why the same text and passphrase never produce the same output twice.

Why does decryption fail with the right passphrase?

Part of the string is probably missing or changed. AES-GCM carries an authentication tag and rejects any change to the ciphertext or its parameters. Copy the whole string at once and make sure nothing was added or removed.

Can I send the encrypted text by email or chat?

Yes, the output is already encrypted and unreadable without the passphrase. Send the passphrase through a different channel and never in the same message, otherwise the encryption adds little.

Is this tool suitable for encrypting files?

It is built for text. Large files are better handled by a dedicated file-encryption tool using the same standards. A small text file can be pasted here, but this page is slow and impractical for large files.

Are the text or passphrase sent anywhere?

No. Encryption and decryption use WebCrypto in your browser, and no request carries the text or passphrase. That guarantee only covers this page, so check the address and avoid lookalike sites.