代码改变世界

SaltEnabled= False 与 SaltEnabled= true

2005-06-02 23:33  无常  阅读(718)  评论(0编辑  收藏  举报
刚才测试时无意发现Cryptography Application Block默认配置SaltEnabled= true,每次用下面这段代码返回的散列码都不一样。
            this.textBox4.Text = System.BitConverter.ToString( p );
            
this.textBox5.Text = System.BitConverter.ToString(Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.CreateHash("passwordHash",System.Text.Encoding.Unicode.GetBytes(this.textBox3.Text.Trim())));

AlgorthmType:System.Security.Cryptography.MD5CryptoServiceProvider, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Enterprise Library Documentation、google和百度上都没找到这个说明