如何比较我从用户输入插入到数据库中的加密密码?我注意到在测试我的程序时,我创建了一个帐号,它们都具有相同的密码,但它们具有不同的加密,我怎么知道用户输入是否与数据库中的输入相同? Encrypto是这样做的吗?或Encrypto有一个独特的方式来确定哪个是哪个?比较数据库中的加密密码和使用加密的用户输入
我是否在此代码中使用了Encrypto?
var hasher = new Hasher();
hasher.SaltSize = 16;
//Encrypts The password
var encryptedPassword = hasher.Encrypt(txtPass.Text);
Account newUser = new Account();
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
newUser.accnt_User = txtUser.Text;
newUser.accnt_Position = txtPosition.Text;
newUser.accnt_Pass = new System.Data.Linq.Binary(encoding.GetBytes(encryptedPassword));
它是做你想做的?我没有看到你指出了你正在使用什么类型的加密,更不用说生成密钥和盐了,你知道加密密码不安全吗? – 2012-02-24 19:50:59
我使用这个http://encrypto.codeplex.com/ – KyelJmD 2012-02-24 19:52:26
看看http://thecodemechanic.wordpress.com/2011/06/07/introduction-to-strong-cryptography-p1-0-hash-功能 - 美国爱国者/ – 2012-02-24 20:02:44