Decrypt AES-256-CBC text online
AES-256-CBC is the combination you meet most often: it is Laravel's default cipher and the usual choice in many libraries. This page decrypts Base64-encoded AES-256-CBC text from its 32-byte key and its IV. To go the other way, use the encrypt AES 256 CBC page.
Use it to check a value during development, compare the output of two languages or read a test message, with nothing to install.
How to decrypt AES-256-CBC text
- Paste the Base64-encoded ciphertext into the text area.
- Type the key into the Salt field (despite the label, it is the key): 32 characters for AES-256.
- Enter the 16-character IV used for encryption in IV (optional).
- Click Decrypt, then Copy to grab the plaintext.
A key that is too short is padded with null bytes; one that is too long is cut to 32 bytes. If the IV is left empty, the tool uses the fixed IV of the site's AES-256-CBC encryption page, so that only suits messages encrypted there without an IV. The work is done on the server with OpenSSL: text and key are sent over HTTPS and are not stored. To be on the safe side, do not paste production secrets.
CBC mode and the 256-bit key
In CBC the 16-byte blocks are chained: each one depends on the previous ciphertext block, and the first depends on the IV. The recipient therefore has to know the IV. CBC does not check that the message is intact either, which is why tools such as Laravel add a signature (MAC) on top.
An AES-256 key is 32 bytes and the algorithm runs 14 rounds. Some markers to avoid picking the wrong size: a 256-bit key is 64 characters in hex and 44 characters in Base64. A string of 32 hex characters, on the other hand, is only 16 bytes: that is an AES-128 key.
Decryption fails or returns nothing: common causes
On failure, the result box shows false or error instead of text. Things to check:
- Wrong key: it must match character for character (case, a stray space or line break).
- Wrong IV: the field was left empty although the sender used their own, or the IV is not 16 characters long.
- Wrong mode or key size: an AES-128-CBC or AES-256-ECB message will not decrypt here. Use decrypt AES 128 CBC or decrypt AES 256 ECB instead.
- Input that is not Base64: hex ciphertext, URL-safe Base64 with
-and_, or a message cut short while copying. - Password-derived key: CryptoJS with a passphrase or
openssl enc -pbkdf2compute the key and IV from a password and a salt. Such messages start withU2FsdGVkX1, and the tool does not handle that derivation.
The equivalent PHP call
$plain = openssl_decrypt(base64_decode($text), 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);
A handy variant when the ciphertext is already decoded: with OPENSSL_RAW_DATA the function receives raw bytes. Key and IV can then be binary strings, which the form cannot accept.
Frequently asked questions
Can I decrypt a value encrypted by Laravel?
Not directly. Laravel outputs Base64 that wraps a JSON object holding the IV, the value and a signature, and its key is 32 binary bytes. The tool expects a key and an IV typed as text, so use the PHP call above.
My message starts with U2FsdGVkX1 and nothing comes out. Why?
That prefix decodes to "Salted__": the message was encrypted with a password (CryptoJS, openssl enc). The real key is derived from that password and a salt, a step the tool does not perform.
My key is shorter than 32 characters. Is that a problem?
The tool pads it with null bytes. Decryption only succeeds if the sender did the same.