Deriving a crypto key from a password
<p>I am trying to generate a key using the .net 2.0 PasswordDeriveBytes class.</p>

<pre><code>  PasswordDeriveBytes pdb = new PasswordDeriveBytes("blahblahblah",null);
  byte[] iv = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 };
  byte[] key = pdb.CryptDeriveKey("TripleDES", "SHA1", 128, iv);
</code></pre>

<p>The code throws "CryptographicException: Invalid flags specified." when trying to execute the CryptDeriveKey method above. I'm trying to encrypt a database entry in asp.net and this is my first shot a crypto. I'd appreciate any help.</p>
