title: Encrypted communication C# <-> PHP using RSA and AES
body: <p>I need an encrypted communication between C# and PHP and unfortunately can't use modules like OpenSSL on server-side. I found RSACryptoServiceProvider and <a href="http://www.codeproject.com/Articles/38739/RSA-Private-Key-Encryption" rel="nofollow">this article</a>.</p>
  
  <p>It is said that I can't use the RSACryptoServiceProvider to encrypt and decrypt something, so there is an own implementation in the article. But I found provider.Encrypt(...) and provider.Decrypt(...), so why not?</p>
  
  <p>If I have something to use RSA in C#, I thought about something like this:
  If php wants to send some data:</p>
  
  <ul>
  <li>php sends its public key to C# </li>
  <li>C# encrypts an key for AES with the public key from php and sends it to php</li>
  <li>php encrypts its message with AES and sends it to C#</li>
  </ul>
  
  <p>(and backwards it's more or less the same)
  Would that be possible or is there any security problem on this?</p>