I generated a key pair (public and private), and from console by:
openssl smime -encrypt -aes256 -in backup.sql -binary -DEM -out outform backup_encrypted.sql public_key.pem
I encrypt the file correctly. Sql, as I can do this with php? I've tried several and nothing Functions
Here I leave one of them.
$data=file_get_contents("backup.sql");
$key=file_get_contents("public_key.pem");
openssl_public_encrypt($data,$output,$key);
echo $output;
$output returns nothing .. Thank you.