如何从SQL服务器解密密码? [英] How to decrypt a password from SQL server?
问题描述
select pwdencrypt('AAAA')
其中输出加密的AAAA字符串:
0x0100CF465B7B12625EF019E157120D58DD46569AC7BF4118455D12625EF019E157120D58DD46569AC7BF4118455D
如何转换(解密)其来源(这是AAAA)的输出?
我相信pwdencrypt正在使用哈希,因此您无法真正反转散列字符串 - 算法设计为不可能。
如果您正在验证用户输入常规技术的密码是将其哈希,然后将其与数据库中的散列版本进行比较。
这是您如何验证被输入的表
SELECT password_field FROM mytable WHERE password_field = pwdencrypt(userEnteredValue)
将userEnteredValue替换为(大惊喜)用户输入的值: p>
I have this query in sql server 2000:
select pwdencrypt('AAAA')
which outputs an encrypted string of 'AAAA':
0x0100CF465B7B12625EF019E157120D58DD46569AC7BF4118455D12625EF019E157120D58DD46569AC7BF4118455D
How can I convert (decrypt) the output from its origin (which is 'AAAA')?
I believe pwdencrypt is using a hash so you cannot really reverse the hashed string - the algorithm is designed so it's impossible.
If you are verifying the password that a user entered the usual technique is to hash it and then compare it to the hashed version in the database.
This is how you could verify a usered entered table
SELECT password_field FROM mytable WHERE password_field=pwdencrypt(userEnteredValue)
Replace userEnteredValue with (big surprise) the value that the user entered :)
这篇关于如何从SQL服务器解密密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!