且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我有一个加密密码方法需要在c#中解密密码方法。

更新时间:2023-09-28 11:51:52

你正在加密 (真正散列)使用MD5的密码。因为它正在被哈希,你不能/不解密它,你只需要比较你的哈希来决定用户是否经过身份验证。



如果你是想要解密密码是一种简单的方法来解决我忘了密码你***在应用程序中实现该功能,以防你的系统遭到入侵并且所有用户密码都被上传到互联网。



但要具体回答这个问题,你需要使用加密算法(例如:blowfish)而不是哈希算法。以河豚为例。



Google [ ^ ]



GitHub - b1thunt3r / blowfish-csharp:C#的Blowfish加密库 [ ^ ]



Blowfish C#和C ++源代码 - 清除安全性 [ ^ ]



Koders代码搜索:Blowfish.cs - C# - GPL [ ^ ]
You are "encrypting" (really hashing) your passwords using MD5. Because it is being hashed you can't/don't decrypt it, you merely compare your hashes to decide if the user is authenticated or not.

If you are wanting to decrypt the password as a easy way to remedy "i forgot my password" you are better off implementing that functionality as part of your App in case your system is compromised and all your users passwords are uploaded to the internets.

But to answer the question specifically, you need to use an encryption algorithm (ex: blowfish) and not a hashing algorithm. Take a look at blowfish for example.

Google[^]

GitHub - b1thunt3r/blowfish-csharp: Blowfish encrytion library for C#[^]

Blowfish C# and C++ Source Code - Defuse Security[^]

Koders Code Search: Blowfish.cs - C# - GPL[^]


引用:

i有一个加密密码方法需要c#中的解密密码方法

i have a Encrypt Password method need decrypt password method in c#



没有解密的可能性,因为 MD5不加密,它是散列的。

哈希是一个单向的过程,无法逆转。



MD5 - *** [ ^ ]

哈希函数 - *** [ ^ ]


There is no decryption possibility because MD5 is not encryption, it is hashing.
Hashing is a one way process and can't be reversed.

MD5 - Wikipedia[^]
Hash function - Wikipedia[^]