如何在C#中解密SHA1托管密码 [英] How to decrypt SHA1Managed password in c#

查看:97
本文介绍了如何在C#中解密SHA1托管密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在解密SHA1托管密码时遇到问题.

I have problem to decrypt SHA1Managed password.

         SHA1 HashProvider = new SHA1Managed();

        SHA1Managed HashProvider = new SHA1Managed();

         HashProvider.Initialize();

        HashProvider.Initialize();

         _PasswordBytes = HashProvider.ComputeHash(_PasswordBytes);

        _PasswordBytes = HashProvider.ComputeHash(_PasswordBytes);

         HashProvider.Clear();

        HashProvider.Clear();

         字符串 _Res_Password =";

        string _Res_Password = "";

        foreach (_PasswordBytes中的字节b)

        foreach (Byte b in _PasswordBytes)

         {

        {

+ = b.ToString("x2");

            _Res_Password += b.ToString("x2");

         }

        }

Could any one please let me know how I can decrypt my password to plan text.

推荐答案

您好vicky7864544

Hi vicky7864544,

谢谢您在这里发布.

对于您的问题,SHA1Managed无法解密.

For your question, SHA1Managed could not be decrypt.

已加密.通常使用对称加密(用于加密和解密的一个密钥),加密的密码也位于单个密码中 柱子.

Encrypted. Usually using symmetric encryption (the one key to both encrypt and decrypt), the encrypted password also sits there in a single column.

散列.单向过程(您可以散列,但不能散列),希望密码附带一个盐,每个盐都位于 自己的列.

Hashed. A one-way process (you can hash but not un-hash), the password is hopefully accompanied by a salt, each of which sit in their own columns.

例如,您具有用于登录网站的用户名和密码.但是,有一天,您忘记了密码.为了安全起见,您可以使用邮件或电话号码更改新密码.该网站不能给你旧的 直接输入密码.如果可以,我认为该网站是不安全的.通过这种方式,我们可以使用SHA1.

For example, you have a username and password to login in a website. But, one day, you forget the password. For security, you could use mail or phone number to change a new password. The website could not give you the old password directly. If it could do that, I think the website is unsafe. For this way, we could use the SHA1.

哈希为用作固定大小的唯一值,表示大量数据.当且仅当两组数据的哈希值应匹配 如果相应的数据也匹配.数据的较小更改会导致哈希表发生较大的不可预测的变化.

The hash is used as a unique value of fixed size representing a large amount of data. Hashes of two sets of data should match if and only if the corresponding data also matches. Small changes to the data result in large unpredictable changes in the hash.

我希望这会对您有所帮助.

I hope this would be helpful to you.

如果还有其他问题,请随时与我们联系.

If you have something else, please feel free to contact us.

最好的问候,

温迪


这篇关于如何在C#中解密SHA1托管密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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