Cryptography

Decrypt AES ciphertext with a passphrase

AES Decrypt recovers plaintext from OpenSSL-style salted AES-256-CBC ciphertext, the Base64 strings that begin with U2FsdGVkX1, once you give it the passphrase used to encrypt them. Developers use it to unwrap secrets sent over chat, to check payloads from CryptoJS-based code and to read values written by openssl enc. With a wrong passphrase there is no plaintext: the Output box shows an error instead.

How to use AES Decrypt

  1. Open AES Decrypt in the Toolbox101 app.
  2. Paste the full ciphertext into the Ciphertext (Base64) box, starting with U2FsdGVkX1. Line breaks are ignored.
  3. Type the passphrase used for encryption into the Passphrase box. Every character counts, including case and spaces.
  4. Read the recovered plaintext in the Output box.
  5. Click Copy to take it, or fix the passphrase if the box shows an error.

Worked example

AES Decrypt returns the output below for this combination.

Input

U2FsdGVkX195oJt97dyycm2D0xjntYtlMgQuAsig8h12Ltf2WXtjKEio245wx6DXntJITenA41WWIyM9Sh+BeA==

Key

aes-demo-key

Output

The quick brown fox jumps over the lazy dog

Check it yourself: open AES Decrypt and enter the same input and key.

Frequently asked questions

What happens if I enter the wrong passphrase?

Usually you get "Could not decrypt" and no text. The tool cannot tell a wrong passphrase from damaged ciphertext, so check the passphrase first, then that the whole string was pasted. CBC mode has no integrity check, so now and then a wrong passphrase gives noise that happens to be valid text instead of an error.

What ciphertext formats does this tool accept?

Salted OpenSSL-style Base64 that starts with U2FsdGVkX1: output from the AES Encrypt tool here, from CryptoJS, and from openssl enc -aes-256-cbc -md md5. The Salted__ header has to be present because the key comes from the passphrase plus that salt. Ciphertext made with openssl enc -pbkdf2, or with AES-GCM, uses a different derivation or mode and will not decrypt here.

How does AES-256-CBC work?

AES is the Advanced Encryption Standard from FIPS 197, a symmetric block cipher. AES-256-CBC means a 256-bit key in Cipher Block Chaining mode with PKCS#7 padding: each 16-byte block is XORed with the previous ciphertext block before encryption, so repeated plaintext blocks do not repeat in the output, and padding rounds the length up to a whole block.

Use AES Decrypt now

Runs in your browser. Nothing you type is uploaded.