在asp.net中将sql二进制密码解密为字符串密码md5 [英] decrypt sql binary password to string password md5 in asp.net

查看:98
本文介绍了在asp.net中将sql二进制密码解密为字符串密码md5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将sql binay密码解密为asp.net中的字符串密码

decrypt sql binay password to string password in asp.net

推荐答案

不,对不起,这没有多大意义.但我会尽力弄清您要做什么...

MD5没有密码,无法解密.因此,我认为您正在执行的工作是计算密码的MD5哈希值,并将其存储在SQL Binary字段中.
现在,您要检查用户是否输入了正确的密码,或者告诉他输入的密码是什么.

1)检查密码.不要尝试从SQL存储的版本还原为字符串并进行比较.而是以与最初存储密码时完全相同的方式生成MD5哈希,然后比较两个二进制数组. (此处有一个技巧介绍:密码存储:操作方法. [^ ]

2)算了MD5不是加密算法.这是一个哈希算法.最大的区别在于加密可以逆向进行:您可以解密以返回到唯一的加密方式.散列不能-这是一种单向过程,您无法从MD5值返回到唯一的原始过程.
No, sorry, that doesn''t make a lot of sense. But I will try to work out what you are trying to do...

MD5 doesn''t have a password and can''t be de-crypted. So what I think you are doing is working out the MD5 hash of a password, and storing it in an SQL Binary field.
Now, you want to either check if the user has entered the right password, or tell him what the password he entered is.

1) Check password. Do not attempt to work back from the SQL stored version to a string and compare them. Instead, generate the MD5 hash in exactly the same way that you did when you stored the password in the first place, and compare the two binary arrays. (there is a Tip covering some of this here: Password Storage: How to do it.[^]

2) Forget it. MD5 is not an encryption algorithm. It is a Hashing algorithm. The big difference is that encryption can be reversed: you can decrypt to get back to the one and only original. Hashing cannot - it is a one way process and you cannot get back to the one and only original from the MD5 value.


这篇关于在asp.net中将sql二进制密码解密为字符串密码md5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆