Uknown cipher algorithm in openssl

Viewed 287

I'm getting the following error message

unknown cipher algorithm

when trying to use the PHP function openssl_encrypt(). The defined cipher is "aes-128-cbc-hmac-sha256" which the whole team uses, but on my machine (with docker, macbook pro m1) this cipher doesn't appear in the array, when i run the function openssl_get_cipher_methods(). Is there an opportunity to add the defined cipher to my openssl config somehow?

I'm running on openssl 1.1.1n

1 Answers

That is a very special purpose cipher. From the OpenSSL man page for it:

WARNING: this is not intended for usage outside of TLS and requires calling of some undocumented ctrl functions. These ciphers do not conform to the EVP AEAD interface.

https://www.openssl.org/docs/man1.1.1/man3/EVP_aes_128_cbc_hmac_sha256.html

It is intended for use from libssl for implementing TLS and is not intended for general purpose use - unless you happen to be implementing a TLS library yourself.

Most importantly this cipher is not available on all platforms. Even when present it requires the use of undocumented ctrl functions. Unless you understand what those are and how to use them you are very likely to be using this cipher incorrectly.

Is there an opportunity to add the defined cipher to my openssl config somehow?

No - it is not available on all platforms.

I would strongly advise against its use.

Related