Score:0

PHP openssl_seal always generate empty encrypted_keys

cn flag

I'm using Ubuntu 22.04.2 LTS (Jammy).

Every time I call openssl_seal(), it always generates empty encrypted_keys.

I have enabled OpenSSL in PHP:

❯ php -i | grep -i openssl
SSL Version => OpenSSL/3.0.2
libSSH Version => libssh/0.9.6/openssl/zlib
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 3.0.2 15 Mar 2022
OpenSSL Header Version => OpenSSL 3.0.2 15 Mar 2022
Openssl default config => /usr/lib/ssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
Native OpenSSL support => enabled

Has anyone experienced the same situation before, and how did you handle the problem?

David avatar
cn flag
It may be helpful if you add the version of Ubuntu to the question. Use edit and add it not in comments please.
in flag
Welcome to AskUbuntu. Is the problem with OpenSSL? Or with PHP's `openssl_seal()` function? The two are very different. If it's with the PHP function, there are a minimum of 4 variables that need to be provided in order for it to encrypt. The function itself does not create the encryption keys.
Meirza avatar
cn flag
Hi @matigo, I have provided all the parameters with complete values.
in flag
I'm seeing an incomplete set of information. If this is "all the parameters", then it's pretty obvious why the PHP function doesn't do anything ... because it's not being provided any criteria/
waltinator avatar
it flag
What directory (full path) are you trying to write to, what are it's permissions (`ls -l`), and what UID and GID are you running as? Explore your Mount/Read/Write/Execute problems with `https://github.com/waltinator/pathlld`, a `bash` script to show the permissions, mount options along the path to an object or objects.
Score:0
lu flag

I had the same issue, and I discovered that OpenSSL 3 had removed support for the insecure algorithm I am forced to still use. After adding the legacy provider to the openssl config file and restarting apache, it works for me now. Reference this from OpenSSL https://www.openssl.org/docs/man3.0/man7/migration_guide.html#Legacy-Algorithms and you can reference this article to add the legacy provider... https://www.practicalnetworking.net/practical-tls/openssl-3-and-legacy-providers/

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.