【发布时间】:2009-01-13 11:51:03
【问题描述】:
我正在尝试使用 .net 2.0 PasswordDeriveBytes 类生成密钥。
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);
代码抛出“CryptographicException:指定的标志无效”。尝试执行上面的 CryptDeriveKey 方法时。我正在尝试加密 asp.net 中的数据库条目,这是我第一次尝试加密。如有任何帮助,我将不胜感激。
【问题讨论】: