ToolForge
Advertisement

Text Encrypt / Decrypt

AES-256-GCM text encryption with a passphrase

Written by toolforge.websiteLast reviewed How we build and check these tools

Text Encrypt / Decrypt tool

Text Encrypt / Decrypt: key facts

What it does
AES-256-GCM text encryption with a passphrase
Category
Security
Cost
Free, with no account, sign-up, or install.
Your data
Runs entirely in your browser — the files and text you enter are never uploaded to a server.
Last reviewed
. Report an incorrect result.
Advertisement

Understanding the Text Encrypt / Decrypt

When you need to share a password, an API key, or a private note through an untrusted channel — a public Slack, an email thread, a shared document — symmetric encryption gives the recipient the ability to decode it without exposing the plaintext along the way. This tool implements AES-256-GCM, a mode of the Advanced Encryption Standard that provides both confidentiality and authentication, meaning a tampered ciphertext will fail to decrypt rather than produce garbled output.

The tool uses the native Web Crypto API built into every modern browser and never sends any data to a server. The passphrase is processed through PBKDF2 with 100,000 iterations of SHA-256 to derive a 256-bit encryption key, which slows down brute-force attacks on weak passphrases. The output is Base64-encoded so it can be safely copied into emails, JSON fields, or any text channel. Use cases include encrypting credentials before committing them to a repository, sending private notes over unencrypted channels, and creating encrypted backups of sensitive strings.

Getting a result

  1. Select "Encrypt" or "Decrypt" mode using the toggle at the top.
  2. In Encrypt mode, paste your plaintext into the input area. In Decrypt mode, paste the Base64 ciphertext you received.
  3. Enter your passphrase in the passphrase field — use a strong, unique passphrase that both parties know. Click the eye icon to reveal and confirm what you typed.
  4. Click the action button. The result appears in the output area ready to copy. Use "Swap to Input" to move the output back for a second operation.

Real AES-GCM, with a derived key

This is genuine cryptography rather than an obfuscation trick. Your passphrase is stretched into a 256-bit key using PBKDF2 with SHA-256 over 100,000 iterations against a random 16-byte salt, and the message is then encrypted with AES-GCM using a random 12-byte initialisation vector. Salt, IV, and ciphertext are packed together and base64-encoded so the result is one copyable string.

Each element earns its place. The salt means the same passphrase produces a different key every time, so identical messages do not yield identical output and precomputed tables are useless. The iteration count makes each guess expensive for anyone attacking the passphrase by brute force. GCM is an authenticated mode, so decryption fails outright if the ciphertext has been altered rather than silently returning corrupted text.

All of it runs through the browser's Web Crypto implementation, on your machine. Neither the message nor the passphrase is transmitted.

key = PBKDF2-SHA256(passphrase, random 16-byte salt, 100,000 iterations) → AES-256 cipher = AES-GCM(key, random 12-byte IV, plaintext) output = base64(salt ‖ IV ‖ ciphertext)
  • Encrypting the same text twice with the same passphrase produces different output, because the salt and IV are fresh each time.
  • Changing a single character of the ciphertext makes decryption fail rather than produce garbage — that is the authentication working.
  • A wrong passphrase is indistinguishable from tampering: both simply fail.

Reasons to use it here

  • AES-256-GCM is a military-grade authenticated encryption mode. Unlike unauthenticated modes like AES-CBC, GCM detects any modification of the ciphertext and refuses to decrypt, protecting against padding-oracle and bit-flipping attacks.
  • PBKDF2 with 100,000 iterations imposes a deliberate computational cost on any attacker trying to guess the passphrase by brute force, buying significant time even if the ciphertext is stolen.
  • Everything runs in the browser. The passphrase, the plaintext, and the ciphertext are never transmitted to any server. You can verify this by loading the page, disconnecting from the internet, and encrypting a message — it still works.
  • A random 16-byte salt and 12-byte IV are generated for every encryption operation, so encrypting the same message with the same passphrase twice produces different ciphertexts, preventing pattern analysis.

The passphrase is the whole security

Strong cryptography with a weak passphrase is weak. AES-256 is not going to be broken, so an attacker will attack the passphrase instead — and 100,000 PBKDF2 iterations raise the cost per guess without making a dictionary word safe. Use a long, random passphrase, and a series of unrelated words is both stronger and easier to remember than a short string of substituted characters.

Losing the passphrase means losing the data. There is no recovery mechanism, no backdoor, and no reset: that is the point of the design, and it is worth understanding before encrypting something you cannot afford to lose. Storing the passphrase in a password manager is the sensible approach.

Two limits on scope. Getting the ciphertext to someone else securely is a separate problem this does not solve — sending the passphrase alongside the message defeats the exercise, so use a different channel. And this encrypts a block of text, not files, and it is not a substitute for full-disk encryption, an encrypted messenger, or a password manager. For sustained confidential communication, use a tool designed for it.

Frequently Asked Questions

What happens if I forget my passphrase?

The data is permanently unrecoverable. AES-GCM is a symmetric cipher — there is no master key, no recovery email, and no way to derive the passphrase from the ciphertext. Write the passphrase down in a secure location (a password manager, for example) before you share the ciphertext.

Is AES-256-GCM safe for sensitive data?

Yes. AES-256-GCM is approved by the U.S. National Institute of Standards and Technology (NIST) and is used in TLS 1.3, SSH, and encrypted messaging protocols worldwide. The security depends on using a strong, random-looking passphrase — the algorithm itself has no known practical weaknesses.

What is PBKDF2 and why does it matter?

PBKDF2 (Password-Based Key Derivation Function 2) converts a human-memorable passphrase into a cryptographic key by running it through a hash function many thousands of times. This means an attacker trying every possible passphrase must spend the same computational cost per guess, making brute-force attacks against weak passphrases orders of magnitude slower.

Can I store the Base64 ciphertext anywhere?

Yes — the ciphertext is designed for text channels. It contains no information about the plaintext without the passphrase, so it is safe to publish publicly. However, ensure the passphrase is shared through a completely separate, secure channel to avoid both being intercepted at once.

Related Tools

Advertisement
Buy Me a Coffee