title: Diffie-Hellman cryptographic algorithm is not supported on this platform
body: <p>I am keep having this problem.</p>
  <blockquote>
  <p>The specified cryptographic algorithm is not supported on this platform.</p>
  <p>Exception Details: System.PlatformNotSupportedException: The specified cryptographic algorithm is not supported on this platform.</p>
  </blockquote>
  <p>The below is the code.  This codes are failed on Windows XP Pro SP3 and Windows 2003 Server with 3.5 framework installed on it.</p>
  <pre><code>&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; %&gt;
  
  &lt;%@ Import Namespace=&quot;System&quot;%&gt;
  
  &lt;%@ Import Namespace=&quot;System.Web&quot;%&gt;
  
  &lt;%@ Import Namespace=&quot;System.Security.Cryptography&quot;%&gt;
  
  
  
  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
  
  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  
  &lt;head runat=&quot;server&quot;&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
    &lt;%
  
      //http://blogs.msdn.com/b/shawnfa/archive/2007/01/22/elliptic-curve-diffie-hellman.aspx
  
      //http://msdn.microsoft.com/en-us/library/cc488021.aspx is about 200-millisecond wait.
  
      ECDiffieHellmanCng alice = new ECDiffieHellmanCng();
  
      alice.KeyDerivationFunction = ECDiffieHellmanKeyDerivationFunction.Hash;
  
      alice.HashAlgorithm = CngAlgorithm.Sha256;
  
      ECDiffieHellmanCng bob = new ECDiffieHellmanCng();
  
      bob.KeyDerivationFunction = ECDiffieHellmanKeyDerivationFunction.Hash;
  
      bob.HashAlgorithm = CngAlgorithm.Sha256;
  
      byte[] bobKey = bob.DeriveKeyMaterial(alice.PublicKey);
  
      byte[] aliceKey = alice.DeriveKeyMaterial(bob.PublicKey);
  
      AesCryptoServiceProvider aes = new AesCryptoServiceProvider();
  
      aes.Key = aliceKey;
  
      
  
       %&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>