Cryptography

Encrypt text with AES-256 and a passphrase

AES Encrypt turns plaintext into AES-256-CBC ciphertext using a passphrase. Developers use it to pass a secret through chat or email, to test interop with CryptoJS-based code or an openssl enc pipeline, and to wrap small config values. The output is OpenSSL-style salted Base64: every string starts with U2FsdGVkX1, and a random salt means the same message and passphrase never give the same ciphertext twice.

How to use AES Encrypt

  1. Open AES Encrypt in the Toolbox101 app.
  2. Type or paste the text you want encrypted into the Message box.
  3. Type a passphrase into the Passphrase box. You need the same one to decrypt, so make it long and keep it apart from the ciphertext.
  4. Read the ciphertext in the Output box; it updates as you type and always starts with U2FsdGVkX1.
  5. Click Copy to put the ciphertext on your clipboard.

Worked example

AES Encrypt gives a different result every time, so yours will differ. This is one run:

Input

The quick brown fox jumps over the lazy dog

Key

aes-demo-key

Output

U2FsdGVkX195oJt97dyycm2D0xjntYtlMgQuAsig8h12Ltf2WXtjKEio245wx6DXntJITenA41WWIyM9Sh+BeA==

Frequently asked questions

Why does encrypting the same text give different output every time?

Every run generates a fresh random 8-byte salt and stores it in the output. The Base64 decodes to the ASCII marker Salted__, then the salt, then the encrypted bytes, so the same message and passphrase never encrypt to the same string twice. Any one of the outputs decrypts correctly.

Can OpenSSL decrypt this tool's output?

Yes, with the legacy key derivation: openssl enc -d -aes-256-cbc -a -A -md md5 -pass pass:YOURPASSPHRASE. The tool derives the key with OpenSSL's MD5-based EVP_BytesToKey at one iteration, which is what openssl enc did before version 1.1.0 switched its default digest to SHA-256. Without -md md5 a modern OpenSSL derives a different key and reports a bad decrypt. The same command with -e instead of -d makes ciphertext this tool can decrypt.

Is a passphrase as strong as a real 256-bit key?

No. The AES-256 algorithm is sound, but the key is made from your passphrase in a single fast MD5-based pass, which is cheap to brute-force. A short or reused passphrase is the weak point whatever the cipher. Use a long random one, and for anything valuable derive keys with PBKDF2, scrypt or Argon2 in code you control.

Does this protect against tampering?

No. CBC mode with a passphrase gives confidentiality only: nothing detects changes to the ciphertext. If you need integrity as well, use an authenticated mode such as AES-GCM in code you control.

How is AES different from RC4 or Rabbit here?

AES is a block cipher (128-bit blocks, CBC mode here) and the only one of the three recommended for new data, with NIST approval and hardware acceleration on most CPUs. RC4 and Rabbit are stream ciphers that add no padding; RC4 is broken and Rabbit never got wide standardisation.

Use AES Encrypt now

Runs in your browser. Nothing you type is uploaded.