Decrypt OpenSSL and CryptoJS text

Runs in your browser

Paste text that starts with U2FsdGVkX1 and the passphrase. The tool tries every cipher of openssl enc and every key derivation and tells you which one it was. Nothing leaves your browser.

More options
Waiting for input

Paste the text and the passphrase

Base64 that starts with U2FsdGVkX1, hex, or a binary file from openssl enc. Cipher and key derivation are found automatically.

Examples

Start from an example

Each example fills in the tool above and decrypts it. All keys and passwords are demo values made for this page.

The format

What “U2FsdGVkX1” means

U2FsdGVkX1 is Base64 for the eight letters Salted__. That header is written by openssl enc and by CryptoJS.AES.encrypt(text, "passphrase"). It is followed by an 8-byte salt and the encrypted data. Nowhere does the file say which cipher or which key derivation was used, which is why decrypting it elsewhere so often fails.

BytesWhat it is
1–8Salted__ (Base64 U2FsdGVkX1)
9–16Salt: random, makes the same passphrase give a new key every time
17–…The encrypted data, padded to the block size (CBC, ECB) or exactly as long as the text (CTR, CFB, OFB, RC4, ChaCha20)

Key and IV come from passphrase and salt. Which way depends on the program and its version:

WhoKey derivationFlag
CryptoJS, OpenSSL before 1.1.0EVP_BytesToKey with MD5, one round-md md5
OpenSSL 1.1.0 and newerEVP_BytesToKey with SHA-256, one round-md sha256 (default)
OpenSSL with -pbkdf2PBKDF2-HMAC-SHA256, 10,000 rounds by default-pbkdf2, -iter

The tool tries all 101 ciphers of openssl enc with all key derivations, the common ones first. With block ciphers the padding check makes a match certain; with stream modes readable text is the hint, and the page says so.

In your terminal

The same with OpenSSL and Node.js

OpenSSL 1.1+
openssl enc -d -aes-256-cbc -a -A -in secret.txt -pass pass:'your passphrase'
With -pbkdf2
openssl enc -d -aes-256-cbc -pbkdf2 -iter 10000 -a -A -in secret.txt -pass pass:'your passphrase'
From CryptoJS
# CryptoJS uses MD5 for the key derivation
openssl enc -d -aes-256-cbc -md md5 -a -A -in secret.txt -pass pass:'your passphrase'
CryptoJS
const CryptoJS = require("crypto-js");
const text = CryptoJS.AES.decrypt("U2FsdGVkX1…", "your passphrase").toString(CryptoJS.enc.Utf8);
Common errors

Why “bad decrypt” or “Malformed UTF-8 data”

bad decrypt

Wrong passphrase, wrong cipher or wrong key derivation. The classic: data from OpenSSL 1.0 (MD5) opened with 1.1 or newer (SHA-256). Add -md md5, or let the tool find it.

Malformed UTF-8 data

CryptoJS’s way of saying “wrong passphrase”: the result is noise, and noise isn’t valid UTF-8. Sometimes it returns an empty string instead.

-pbkdf2 forgotten

Text made with -pbkdf2 (or -iter) must be opened with it, otherwise “bad decrypt”. Newer OpenSSL warns “deprecated key derivation used” when you leave it out.

bad magic number

The data doesn’t start with “Salted__”: it was made with -nosalt or with -K and -iv (a key, not a passphrase). Use the AES tool for a key and IV.

A newline too many

echo "text" | openssl enc … encrypts the line break too. Use printf '%s' or echo -n.

Base64 on one line

Without -A, openssl enc -a breaks lines every 64 characters and expects them when decrypting. Both work here.

Under the hood

Tested against the original tools

Every format on this page was checked against values made by the real tool, on 3 December 2026:

  • 70 values made by openssl enc (OpenSSL 3.0) with 21 ciphers and MD5, SHA-1, SHA-256, PBKDF2-SHA256 and PBKDF2-SHA512, different iteration counts, and by the npm package crypto-js (AES, TripleDES, DES, RC4). The cipher and key derivation must be found automatically.
  • What the tool encrypts opens with openssl enc -d.
  • transcrypt uses openssl enc too, so its files open here; ChaCha20 follows OpenSSL’s counter in the first four IV bytes.
  • Not supported: Rabbit from CryptoJS, and AEAD ciphers (openssl enc refuses them).
More formats

Other encrypted formats

Every format has its own page with the same tool. Paste anything into one of them: if it belongs elsewhere, the tool says so and takes it there.

FAQ

Questions about OpenSSL & CryptoJS

Which cipher was used for my U2FsdGVkX1 text?

The text doesn’t say. In practice it is almost always AES-256-CBC: CryptoJS.AES uses it, and most openssl enc commands found online do too. This tool tries every cipher of openssl enc with every key derivation and tells you which one gives readable text.

Can I decrypt it without the passphrase?

No. The key comes from the passphrase; without it there is nothing to try except guessing the passphrase itself.

Why does OpenSSL 3 say “bad decrypt” for an old file?

OpenSSL 1.1.0 changed the default digest for the key derivation from MD5 to SHA-256. Files made before need -md md5. CryptoJS uses MD5 as well.

Is CryptoJS output the same as openssl enc?

Yes, when CryptoJS gets a passphrase: both write Salted__, salt and AES-256-CBC data with an MD5-derived key. That is why openssl enc -d -md md5 opens CryptoJS text. With a key and IV given directly, CryptoJS writes no header.

Is it safe to paste it here?

Everything runs in your browser: nothing you paste is sent anywhere, not even to this site. The page’s Content-Security-Policy blocks connections to other sites; check the Network tab of your browser’s developer tools.

Searches the list of pages on this site. What you type stays in your browser.