title: C# Encrypt an XML File
body: <p>I need two methods one to encrypt and one to decrypt an xml file with a key= "hello world",the key hello world should be used to encrypt and decrypt the xml file.These methods should work on all machines!!! Any encryption methods will do. XML File contents below:</p>
  
  <pre><code>&lt;root&gt;
      &lt;lic&gt;
          &lt;number&gt;19834209&lt;/number&gt;
          &lt;expiry&gt;02/02/2002&lt;/expiry&gt;
      &lt;/lic&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Can some give me a sample?The issue is the msdn sample encyptions make a xml file encypted but when I decrypt on another machine it doesn't work.For example</p>
  
  <p>I tried this sample:
  <a href="http://msdn.microsoft.com/en-us/library/ms229746.aspx" rel="noreferrer">How to: Encrypt XML Elements with Asymmetric Keys</a>,
  but here there is some kinda session and on another machine it says bad data phewf!</p>