- encrypt something with a C++ application using server's public key and send to a PHP application
- PHP application can decrypt it using a private key
- PHP application sends a cleartext response with a signature
- C++ application verifies the message using the signature
Gist of it: among others, there are PKSC1v15 and PSS (Probabilistic Signature Scheme) en/decryption and signature schemes Wiki quote: " In general, RSA-PSS should be used as a replacement for RSA-PKCS#1 v1.5. "
PHP has OpenSSL out of box and for en/decryption it supports OPENSSL_PKCS1_OAEP_PADDING which is PKCS1 with SHA1