我目前正在更新一个网站,以便使用HashBytes SHA2_512盐组合密码进行身份验证。
我的问题是,一旦我这样做了,我的所有当前用户将不再能够使用他们现有的HashBytes SHA2_512密码登录。
有没有办法通过SQL解密(更新)当前的HashBytes SHA2_512密码和HashBytes SHA2_512盐组合密码。
下面是我选择验证的一个示例。
//current which will no longer work once i have updated the page
SELECT intcustomerid, strUserName, strUserPassword
FROM dbo.tblLoginControl WHERE strUserName = 'Dave' AND strUserPassword =HashBytes('SHA2_512', 'Rice205H*!')
//new one once I have update the page
SELECT [AccountName], [AccountPwd]
FROM [dbo].[SecurityAccounts] WHERE [AccountName]= 'Dave' AND [AccountPwd] =HashBytes('SHA2_512', [Salt] + 'Rice205H*!')因此,我需要使用现有密码并使用Salt进行更新。
我不确定是否可以做到这一点,唯一的解决办法是向我的用户发送电子邮件,并要求他们从网站请求新密码?
谢谢。
发布于 2016-05-22 01:58:27
没有办法“解密”一个哈希密码。为什么不添加一个列(位),用于存储密码是否使用盐加密。
然后这只是另一种情况,就像:
AND ((isSalted = false
AND strUserPassword =HashBytes('SHA2_512', 'Rice205H*!'))
or [AccountPwd] =HashBytes('SHA2_512', [Salt] + 'Rice205H*!'))https://stackoverflow.com/questions/37366204
复制相似问题