We have been using some simple approaches to securely transfer messages between
C# . We published our method here on github:
Note, you can use the code not only between PHP-C# communication, but also with each other (PHP-PHP, C#-C#);
You can simple output some string from PHP:
echo EncryptDecrypt::EncryptString ( "Hello message to C#", "mySecretKey123" );
and then read it in C# :
Console.WriteLine( EncryptDecrypt::DecryptString ( encryptedStringFromPhp, "mySecretKey123" ) );
Of course, you can do conversely, encrypt message from C# and send to PHP .
p.s. If you also need other kind of encrypt solution solely for PHP, check this code.