Matches mcrypt_module_open('rijndael-256','', 'ofb',''): key = substr(md5($secretKey), 0, 32), IV used as raw bytes.

Both secret fields are saved in this browser so you don't retype them next visit;Clear All forgets them. Nothing is ever uploaded.

Input
Output

Free Online Rijndael-256 (MCRYPT OFB) Decrypt & Encrypt

This tool decrypts — and encrypts — data written by PHP's mcrypt_generic() / mdecrypt_generic() pair using Rijndael-256 in OFB mode, which is what most legacy PHP frameworks (CakePHP, CodeIgniter, older Laravel encoders, custom encryptData() / decryptData() helpers) used for encrypted cookies, API payloads and database fields. You supply the same two values your PHP code supplies — the secret key and the secret IV — plus the base64 data, and the plaintext appears instantly.

It is a faithful re-implementation of libmcrypt's own Rijndael-256 and OFB modules, built from their source and checked against libmcrypt's built-in Rijndael-256 self-test vector, so the output matches PHP byte-for-byte — including the quirks: the key is the 32-character hex string returned by md5($secretKey) used as raw ASCII bytes, the IV is taken as raw bytes, and an IV that is not exactly 32 bytes is zero-padded or truncated rather than rejected.

How To Decrypt Your Encrypted Data

Paste your Secret Key and Secret IV into the two fields at the top, paste the base64 ciphertext into the Input panel, then press Decrypt (or Ctrl+Enter). The plaintext lands in the Output panel, ready to copy.

If the result is binary junk but you know the values are right, tick Swap key/IV roles. It keeps both fields as labelled and only changes the pairing — the Secret IV is hashed with md5() into the cipher key and the Secret Key becomes the IV — which is what legacy helpers do when their fallbacks read encryption_secret_key and encryption_secret_iv in the opposite order.

To go the other way, paste plaintext into Input and press Encrypt (or Alt+Enter) — you get base64 that your PHP code can decrypt with the same key and IV. Use Swap to feed the output back into the input and confirm the round trip. Whitespace and line breaks inside base64 are ignored, exactly like PHP's non-strict base64_decode().

Rijndael-256 Is Not AES-256 — Why Generic Decoders Fail

The name trips people up: mcrypt's rijndael-256 means a 256-bit block size, not a 256-bit key. Rijndael with a 256-bit block runs 14 rounds over eight 32-bit words and has a different ShiftRows pattern from the 128-bit block that became AES. Every mainstream library — Web Crypto, CryptoJS, Node's crypto, OpenSSL — only implements the 128-bit block, so pasting your key into any "AES decrypt" page returns garbage even with the correct key.

The mode is unusual too. libmcrypt's ofb.c is a byte-wise shift-register OFB: the full 32-byte register is block-encrypted for every single input byte, one keystream byte is consumed, then the register is shifted left and that byte is appended. Because OFB is a stream mode here there is no padding at all — ciphertext length always equals plaintext length, and there is never a "bad padding" error to tell you the key was wrong. That is why a wrong key quietly produces binary junk instead of an error; this tool flags it when the result is not valid UTF-8 and shows you the raw hex.

Migrating Off mcrypt (Removed in PHP 7.2)

PHP deleted the mcrypt_* extension in 7.2, so on any modern runtime you cannot call mdecrypt_generic() to read data your old system wrote. Rijndael-256/OFB has no OpenSSL equivalent either, so the usual openssl_decrypt() one-liner does not exist. This page lets you read those values from any browser — useful while migrating a legacy database column, decoding an old encrypted auth cookie, or auditing what a third-party integration actually stored — and then re-encrypt with a modern AEAD cipher.

Private By Design — Keys Never Leave This Page

Everything runs inside your browser tab: the Rijndael-256 core, the OFB chain, the MD5 key derivation and the base64 layer are plain JavaScript modules served with this page. There is no API call, no server-side decrypt endpoint, and no analytics on your content. Unlike ordinary web "decrypters", you never paste a production secret into somebody else's backend.

The data panels are remembered in your own browser between visits, but the Secret Key and Secret IV are never written to storage — close the tab and they are gone. If you decrypt live production secrets, do it on a machine you control and clear the fields when you are done.

Frequently Asked Questions

Everything you need to know about decrypting Rijndael-256 / MCRYPT_MODE_OFB data.

How do I decrypt data encrypted with PHP mcrypt and a secret key and IV?

Enter the same Secret Key and Secret IV your PHP code hands to mcrypt_generic_init(), paste the base64 ciphertext into the Input panel, and click Decrypt (or press Ctrl+Enter).

Internally this mirrors the PHP call chain: base64_decode(), key = substr(md5($secretKey), 0, 32), IV taken as raw bytes, then mdecrypt_generic() over Rijndael-256 in OFB mode.

Is Rijndael-256 the same as AES-256?

No. In mcrypt, rijndael-256 refers to the 256-bit block size, not a 256-bit key. AES is by definition Rijndael with a 128-bit block. Rijndael-256 runs 14 rounds over eight 32-bit words with a different ShiftRows pattern.

Because Web Crypto, CryptoJS, Node's crypto module and OpenSSL only implement the 128-bit block, every generic "online AES decrypter" returns garbage for this data even when the key is right — the usual reason people conclude their ciphertext is corrupted when it is not.

Can I also encrypt data so my PHP code can decrypt it?

Yes. Put plaintext in the Input panel and click Encrypt (or Alt+Enter). The result is base64 that your PHP code can decrypt with the same key and IV, matching base64_encode(mcrypt_generic($td, $data)).

OFB is symmetric — encrypt and decrypt use the identical keystream — so pressing Swap and running the opposite direction reproduces your original text.

Why does decrypting with the wrong key not give an error?

OFB is a stream mode with no padding and no integrity check, so there is nothing to validate. A wrong key or IV just yields a different keystream, and the plaintext comes out as unreadable bytes.

This tool surfaces the failure for you: when the result is not valid UTF-8 it says so and shows a hex dump, which is far more useful than mojibake for confirming the key was wrong.

What happens if my secret IV is not 32 bytes?

Rijndael-256 requires a 32-byte IV because its block is 32 bytes wide. PHP's mcrypt_generic_init() allocates an IV-sized buffer, zero-fills it, copies your IV in, raises an "Iv size incorrect" warning, and then carries on — meaning a short IV is zero-padded and a longer one is truncated to 32 bytes.

This page reproduces exactly that behaviour and shows the same warning, so a value that looked broken in PHP still decodes here.

Is it safe to paste my secret key into an online tool?

Only if the tool genuinely never transmits it — this one does not. The MD5 key derivation, the Rijndael-256 core, the OFB chain and the base64 layer are all JavaScript modules delivered with this page and executed in your browser. There is no decrypt API, no upload, and no analytics on your content.

The data panels and both secret fields are kept in your own browser's localStorage so you don't retype them next visit. That storage is plaintext on your machine and never leaves it, so Clear All wipes the fields and forgets the key and IV — use it on a shared or borrowed computer, and prefer a machine you control for live production secrets.

Does the ciphertext length tell me anything?

Yes — it is always identical to the plaintext length. libmcrypt's OFB adds no padding, so 148 bytes of ciphertext decode to exactly 148 bytes of plaintext.

If your base64 decodes to an unexpected length, the problem is in the encoding layer (line breaks, URL-safe characters, double-encoding), not in the cipher.

My PHP code swaps the key and IV fallback values — does that matter?

Yes — it changes the whole answer. When those arguments are omitted, legacy helpers fall back to the wrong config entry: $iv = Configure::read('encryption_secret_key') while $secretKey = Configure::read('encryption_secret_iv'). The value named secret_key ends up acting as the IV, and the one named secret_iv is the value md5() turns into the cipher key.

That is why the natural pairing yields binary junk while the crossed pairing yields clean text — the cipher is identical either way. Enter both values in the normal fields and tick Swap key/IV roles; the status line then reads key = md5(Secret IV), IV = Secret Key so you can always tell which chain ran.