How use OpenSSL in delphi and php properly?

  

I have a fmx project as client and use nginx as server. For efficiency i just want to encrypt my username and password. The rest of the information is sent in raw form. I generated keys in php web server but i can’t encrypt user&pass in client side by Delphi fmx client.

<?php
// Configuration settings for the key
$config = array(
“digest_alg” => “sha512”,
“private_key_bits” => 4096,
“private_key_type” => OPENSSL_KEYTYPE_RSA,
);

$res = openssl_pkey_new($config);

openssl_pkey_export($res, $private_key);

$public_key = openssl_pkey_get_details($res);
$public_key = $public_key[“key”];
?>

I get $public_key as string in delphi but i can’t encrypt data properly.

Comments are closed.