Good day,

The challenge I am experiencing is obtaining the contents of the private necessary to decrypt data.

I've reviewed tutorials on public/private key generation and my keys are properly formatted.

To debug, I substituted a pair of keys created a year ago when I took a course on secure log-ins. That pair is known to work properly but does not in this application.

My private key is not encrypted so I do not need the passphrase specified under openssl_pkey_get_private.

Here is the function I am using:

function decrypt ($encrypted) {
    $private_key = openssl_pkey_get_private("file:///login.key");
    /*in the above, have tried file:// and file:/// */
    $encryptedData =  base64_decode($encrypted);
    $data = '';
    openssl_private_decrypt($encryptedData, $data, $private_key);
    return $data;
}

If I run the above through a debugger, $private_key remains FALSE.

In the overall scheme, the private key is supposed to reside on the server. I am only programming on a development system right now. Is that a factor?