How to decrypt a password from SQL server?(如何从 SQL Server 解密密码?)
问题描述
我在 sql server 2000 中有这个查询:
select pwdencrypt('AAAA')
输出一个加密的AAAA"字符串:
<前>0x0100CF465B7B12625EF019E157120D58DD46569AC7BF4118455D12625EF019E157120D58DD46569AC7BF4118455D
如何从其来源(即AAAA")转换(解密)输出?
我相信 pwdencrypt 正在使用散列,因此您无法真正反转散列的字符串 - 该算法的设计是不可能的.
如果您要验证用户输入的密码,通常的技术是对其进行散列,然后将其与数据库中的散列版本进行比较.
这是验证用户输入表的方法
SELECT password_field FROM mytable WHERE password_field=pwdencrypt(userEnteredValue)
用(大惊喜)用户输入的值替换 userEnteredValue :)
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 Server 解密密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从 SQL Server 解密密码?


基础教程推荐
- oracle区分大小写的原因? 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 在多列上分布任意行 2021-01-01