Emulate openssl_decrypt PHP on command line

Avelino Herrera Morales <[email protected]> Wed, 11 Feb 2026 00:36:25 -0800 (PST)
Newsgroups gmane.comp.encryption.openssl.user
Message-ID <[email protected]>
Hi all,

I have a very simple code in PHP to decrypt an AES-256-ECB stream in PHP 
that runs ok:




*$ticketKeyEncHex = 
"3752B8D2A9BBA61682C7E93710DE9527F6C919E0E9678E4BC87C7809E34D5750";$clientSecret 
= "666f3_SOME_HEX_HERE_4d4a";$ticketKeyEncBin = 
hex2bin($ticketKeyEncHex);$ret = openssl_decrypt($ticketKeyEncBin, 
"aes-256-ecb", $clientSecret, OPENSSL_RAW_DATA);    // returns a correct 
decrypted string*

But I do no know how to replicate that call on command line. The following 
command does not generate the same decrypted string:

*$ echo -n 
"3752B8D2A9BBA61682C7E93710DE9527F6C919E0E9678E4BC87C7809E34D5750" | xxd -r 
-ps | openssl enc -d -aes-256-ecb -nosalt -pass 
pass:666f3_SOME_HEX_HERE_4d4a -pbkdf2 -nopad | hexdump -C*

How do I replicate the openssl_decrypt call in cli?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "openssl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/dcfd89f6-2a7f-4fdf-8285-820fd3b864a3n%40openssl.org.