Diffie-Hellman cryptographic algorithm is not supported on this platform
<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="C#" AutoEventWireup="true" %&gt;

&lt;%@ Import Namespace="System"%&gt;

&lt;%@ Import Namespace="System.Web"%&gt;

&lt;%@ Import Namespace="System.Security.Cryptography"%&gt;



&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

&lt;head runat="server"&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>
