The openssl_get_cipher_methods()
function returns, within the list of available algorithms, both aes-256-cbc
and aes-256-cbc-hmac-sha256
so I was trying to understand how to use them with the openssl_encrypt/decrypt()
functions but I see no difference.
php > echo openssl_encrypt('hello world!', 'aes-256-cbc', '5823r4s5b36f45f333c7be91e6819b91', 0, base64_decode('7urdW9TS74FKFgHFSb2sqA=='), $tag);
JmeNeIeK2yU3pVUMGX5VsQ==
php > echo $tag;
php > echo openssl_encrypt('hello world!', 'aes-256-cbc-hmac-sha256', '5823r4s5b36f45f333c7be91e6819b91', 0, base64_decode('7urdW9TS74FKFgHFSb2sqA=='), $tag);
JmeNeIeK2yU3pVUMGX5VsQ==
php > echo $tag;
php >
So, what's going on? Am I missing something?