I need to make a simple very basic encryption with AES 128 ECB mode.
The idea is to generate a cryptogram, code it in base64 and then decipher that text from a web service in php to process its content. Later we will increase the robustness of the encryption with a 256 key and CBC mode.
The problem is that the encrypted text generated from the openssl tool (installed by default in MacOX) generates a completely different result than the one generated by the openssl_encrypt function in php 7.
echo -n 'Sergio Sánchez' | openssl12n enc -aes-128-ecb -a
Result
U2FsdGVkX1+wrLjaCTSM9T3WMV1YcD9Cwzj0mKBoa7M=
No Salt
echo -n 'Sergio Sánchez' | openssl12n enc -aes-128-ecb -nosalt -a
Result
stpJKCaUQ/Q1GLzDvqaYRg==
PHP 7
echo base64_encode(openssl_encrypt('Sergio Sánchez', 'AES-128-ECB', 'password', OPENSSL_RAW_DATA));
Result
dum7MBJOzIi9jvMTvEYnug==
How can I generate a compatible cryptogram between both tools?