Text Encryption Tool

Encrypt and decrypt text with AES-256-GCM and PBKDF2 key derivation, using the browser's own Web Crypto implementation.

Loading tool…

Encryption and decryption run entirely in your browser through the Web Crypto API. Neither your text nor your passphrase is transmitted or stored.

What the Text Encryption Tool does

This text encryption tool will encrypt and decrypt text with AES-256-GCM and PBKDF2 key derivation, using the browser's own Web Crypto implementation. Everything runs inside this page, so the work happens on your own device rather than on a server. It is most often used for sending a sensitive note where the recipient already knows a shared passphrase. If you need the other side of this job, there is also a random string generator.

How to use it

  1. Enter the text and a strong passphrase.
  2. Encrypt — you get a Base64 string containing the salt, nonce and ciphertext.
  3. Share the ciphertext and the passphrase through different channels.
  4. To decrypt, paste the ciphertext and enter the same passphrase.

How it works

The scheme is AES-256 in GCM mode with a key derived from your passphrase by PBKDF2-HMAC-SHA-256 using 310,000 iterations and a fresh 16-byte random salt per message. A fresh 12-byte nonce is generated for each encryption. All of it runs through SubtleCrypto, the same implementation your browser uses for TLS.

GCM is authenticated encryption, which means decryption fails if the ciphertext has been altered rather than silently producing garbage. That is what stops an attacker from flipping bits in transit to change the decrypted result.

The salt and nonce are stored alongside the ciphertext in the output, which is necessary and safe — neither is secret. The output is Base64 so it can be pasted into a message or an email.

The real weakness in any passphrase-based scheme is the passphrase. The key derivation is deliberately slow to make guessing expensive, but a short or common passphrase can still be brute-forced. Use a generated passphrase, and never send it through the same channel as the ciphertext.

This is a utility for one-off messages, not a messaging system. For ongoing private communication, use a tool built for it, where key exchange and forward secrecy are handled properly.

When to use it

  • Sending a sensitive note where the recipient already knows a shared passphrase.
  • Encrypting a short piece of text before storing it somewhere less trusted.
  • Demonstrating how authenticated encryption behaves.

Common mistakes to avoid

  • Sending the passphrase in the same email as the ciphertext, which defeats the point entirely.
  • Using a weak passphrase — the encryption is only as strong as the thing protecting the key.
  • Treating this as a substitute for an end-to-end encrypted messenger.

Frequently asked questions

How strong is this?

AES-256-GCM with PBKDF2 at 310,000 iterations is a current, standard construction. The cipher is not the weak point — your passphrase is. A generated passphrase of five or more random words keeps the whole scheme strong.

Can I recover text if I lose the passphrase?

No. There is no recovery mechanism and no backdoor; that is the point. Without the passphrase the ciphertext is unrecoverable.

Why does decryption fail with the right passphrase?

Usually because the ciphertext was altered in transit — a line break inserted by an email client is the common cause. GCM authenticates the data, so any modification makes decryption fail rather than produce wrong output.

Related tools

See all security & privacy tools →