FormatterHQ

Encrypt & Decrypt Text

Encrypt a short text with a passphrase and decrypt it again, using AES-256 or other ciphers from the CryptoJS library. Handy for learning and testing — read the limits below.

Input TEXT
Output TEXT
Ready.

How to use the Encrypt & Decrypt Text

  1. Paste the text to encrypt, or the Base64 ciphertext to decrypt, into the input editor.
  2. Choose the Algorithm (AES-256 is recommended) and enter the Secret key passphrase.
  3. Click Encrypt or Decrypt in the options panel.
  4. Copy the result; share the passphrase with the recipient through a separate channel.

Encrypt and decrypt text with a passphrase

This tool lets you encrypt and decrypt text with a shared passphrase directly in your browser. It uses the widely used CryptoJS library: the passphrase is turned into a key, the text is encrypted, and the result is a Base64 string you can paste into a message or file. Decrypting needs the same algorithm and the same passphrase.

Example

Encrypting Meet me at 7pm with AES-256 and the passphrase my secret passphrase produces something like:

U2FsdGVkX19Yj0D8GEjyFXy8uvR8Uu6m8Cr7BRf0N8w=

Encrypt the same text again and the output changes, because a new random 8-byte salt is generated each time. The string always starts with U2FsdGVkX1 — Base64 for Salted__ — followed by the salt and the ciphertext.

How it works

  1. A random salt is generated.
  2. The passphrase and salt are fed through OpenSSL’s EVP_BytesToKey function (MD5-based) to derive a key and initialisation vector.
  3. The text is encrypted — for AES, with AES-256 in CBC mode and PKCS#7 padding.
  4. Salt and ciphertext are written in OpenSSL’s “Salted__” format and Base64 encoded.

Because the format is the same as OpenSSL’s, AES output can be decrypted on the command line with openssl enc -d -aes-256-cbc -a -md md5 (add -A for single-line input).

Algorithms

AlgorithmStatus
AES-256Modern standard cipher. Use this one.
Triple DESLegacy; deprecated by NIST. For compatibility only.
DESBroken — its 56-bit key can be brute-forced. Legacy testing only.
RC4Broken — biased output. Legacy testing only.
RabbitStream cipher from eSTREAM; rarely used today.
Blowfish64-bit blocks; superseded by AES.

Honest limits

This tool is good for learning, for testing code that uses CryptoJS or OpenSSL, and for casually obscuring a note. It is not a replacement for a dedicated encryption tool when the stakes are high:

  • Weak key derivation. EVP_BytesToKey with a single MD5 round is fast, so a short or guessable passphrase can be brute-forced. Use a long, random passphrase — for example from the Password Generator.
  • No integrity protection. CBC mode without a MAC cannot detect tampering; a modified ciphertext may decrypt to altered text or fail with a generic error.
  • Key sharing is up to you. Anyone with the passphrase can decrypt. Never send it in the same message as the ciphertext.

For files or sensitive data, prefer established tools such as age, GnuPG or your operating system’s encrypted storage, which use authenticated encryption and slow, salted key derivation.

Privacy

Encryption and decryption run entirely in your browser, and nothing is sent to our server while you work. Save & Share is different: the link stores the text in the input editor (plain text or ciphertext) and the chosen algorithm on our server; the secret key is never stored in a shared link. If you only need a fingerprint rather than reversible encryption, use a hash such as the SHA-256 Hash Generator; for message authentication with a shared key, see the HMAC Generator.

Frequently asked questions

Why is the ciphertext different every time?
A new random salt is generated for each encryption, so the derived key, IV and ciphertext change even for identical input. Decryption still works because the salt is stored in the output.
I forgot the passphrase. Can the text be recovered?
No. Without the correct passphrase and algorithm there is no practical way to decrypt the data. That is the purpose of encryption.
Why does decryption fail with “wrong key, wrong algorithm or corrupted ciphertext”?
The passphrase, the selected algorithm or the ciphertext does not match what was used for encryption. Check all three, and make sure the whole Base64 string was copied.
Can I decrypt the output with OpenSSL?
Yes, for AES: use openssl enc -d -aes-256-cbc -a -md md5 with the same passphrase. The -md md5 option matters because newer OpenSSL versions default to SHA-256 for key derivation.
Is this secure enough for passwords or financial data?
Not on its own. The fast key derivation and lack of integrity checks make it unsuitable for high-value secrets. Use a password manager or authenticated encryption tools for that.

Last updated October 3, 2026

Related tools

Hash Identifier Identify hash types from their format: MD5, SHA-1/256/512, bcrypt, Argon2, sha512crypt, NTLM, MySQL, phpass, Django and more. HMAC Generator Generate HMAC-SHA256, HMAC-SHA1, HMAC-SHA512, HMAC-MD5 and SHA-3 HMACs with a secret key, as hex or Base64. Htpasswd Generator Create .htpasswd entries for Apache and Nginx basic auth with bcrypt, APR1-MD5 or SHA-1 — one username:password per line. Keccak Hash Generator Generate original Keccak-224/256/384/512 hashes, including the Keccak-256 used by Ethereum and Solidity. MD2 Hash Generator Generate the MD2 hash of any text or file online. Instant 128-bit digest in hex, computed in your browser. MD4 Hash Generator Generate the MD4 hash of any text or file online. Instant 128-bit digest in hex, computed in your browser. MD5 Hash Generator Generate the MD5 hash of any text or file online. Instant 128-bit digest in hex, computed in your browser. NTLM Hash Generator Generate the Windows NTLM (NT) password hash — MD4 of the UTF-16LE password — online. Password Strength Checker Estimate password entropy and crack time for online and offline attacks, and spot common patterns — checked privately in your browser. PBKDF2 Hash Generator Generate PBKDF2-HMAC-SHA256/512 derived keys and Django-style password hashes with your own salt and iteration count, using WebCrypto. RIPEMD-160 Hash Generator Generate the RIPEMD-160 hash of any text or file online. Instant 160-bit digest in hex, computed in your browser. RSA Key Pair Generator Generate RSA 2048, 3072 or 4096-bit public/private key pairs in PEM (PKCS#8, PKCS#1) or JWK format with WebCrypto, entirely offline.