title: ASP.Net MVC & WebAPI encryption
body: <p>I want to utilise some form of "simple" encryption that is reasonably secure but very low friction in terms of impact on development process.</p>
  
  <p>Supposing I own both sides of the conversation in a client &lt;> web service situation. My application is a windows phone/win8/silverlight/desktop app and the server is ASP.Net MVC or WebAPI.</p>
  
  <p>In my mind, I want something as simple as:-</p>
  
  <pre><code>&lt;security encryption="off|sometype|someothertype"&gt;
      &lt;privatekey&gt;12345MyKey54321&lt;/privatekey&gt;
  &lt;/security&gt;
  </code></pre>
  
  <p>as some form of configuration parameter on both the client and server. Additionally an authentication routine will return and store some form of public key.</p>
  
  <p>Doing so will enable the 'encryption mode' and result in any http requests being encrypted &amp; hashed in the selected manner using the provided keys. The end result being anything sniffed on the local, proxy or remote machines would not be able to view the data without the key and decryption method. On the server, data is decrypted using the same key before hitting controller actions. </p>
  
  <p>Other than swapping out HttpRequest/WebClient calls for something like EncryptedHttpRequest and adding the appropriate hook on the MVC/WebAPI side of things, all other client code and controller actions would be ignorant to the fact the data was encrypted.</p>
  
  <p>Am I missing something or could setup not be this simple? As far as I have searched there is nothing that offers this level of simplicity so I figure I'm missing some gaping flaw in my logic?</p>