title: Securing A Chat Application
body: <p>I am working to make a secure chat application for Windows Phone 8.</p>
  
  <p>I am planning to use ASMX SOAP Services and I have decided to use Public Key Encryption technique to encrypt data but i am very new to network security.</p>
  
  <p>My approach is :</p>
  
  <ol>
  <li>As soon as the user signs up, a public/private key pair is generated at the server.</li>
  <li>The public key is then sent back to the phone app client and all the data that will
  be sent from the client to the server will be encrypted by the public key on the client
  and decrypted by private key on the server.</li>
  </ol>
  
  <p>Now what I want to know is that for the responses that the server will send to the client, how will those be encrypted and decrypted?</p>
  
  <p>If the private key on the server is used to encrypt the responses, then it can be decrypted by anyone as the "public" key is public.</p>
  
  <p>Do this means that I have to generate two public-private key pairs, one generation 
  on server and one generation on client.</p>
  
  <p>One pair will encrypt and decrypt data that is sent to the server and other pair(generated at client) will be doing the same thing when data is sent from the server in response.</p>