如何解码MD5字符串 [英] How to decode MD5 string
本文介绍了如何解码MD5字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用此代码制作加密密码。我想将生成的字符串解码为原始字符。
I am using this code to make a encrypted password.I want to decode the generated string to its original.
public string CreateHash(string password, string salt)
{
// Get a byte array containing the combined password + salt.
string authDetails = password + salt;
byte[] authBytes = System.Text.Encoding.ASCII.GetBytes(authDetails);
// Use MD5 to compute the hash of the byte array, and return the hash as
// a Base64-encoded string.
var md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] hashedBytes = md5.ComputeHash(authBytes);
string hash = Convert.ToBase64String(hashedBytes);
return hash;
}
推荐答案
MD5哈希不能被解密,这就是MD5的全部要点。
最多,您可以尝试在彩虹表中查找它们。
以下是一些支持此功能的网站:
http://tools.benramsey.com/md5/
MD5 hashes can not be "decrypted", thats the whole point of MD5.
At max, you can try to look them up in a rainbow table.
Here are some sites that support this:
http://tools.benramsey.com/md5/
MD5算法不可能被称为单向散列函数。请参阅: http://en.wikipedia.org/wiki/MD5 [ ^ ]
It's not possible MD5 algorithm is known as one-way hashing function. Please, see this: http://en.wikipedia.org/wiki/MD5[^]
MD5是一种单向算法。它已加密但无法解密。
我仍然有一个代码来解密字符串。
Hi,
MD5 is a one way algorithm. it is encrypted but can't be decrypted.
still i have a code to decrypt the string.
public string DecryptPassowrd(object obj)
{
string password = obj.ToString();
System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
System.Text.Decoder utf8Decode = encoder.GetDecoder();
byte[] todecode_byte = Convert.FromBase64String(password.Replace("","+"));
int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
char[] decoded_char = new char[charCount];
utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
string result = new String(decoded_char);
return result;
}
让我知道它是否适合你?
标记它是否适合您。
谢谢。
Let me know if it works for you or not?
Mark if it works for you.
thanks.
这篇关于如何解码MD5字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文