如何解码MD5字符串

编程入门 行业动态 更新时间:2024-10-28 14:35:27
本文介绍了如何解码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的全部要点。 最多,您可以尝试在彩虹表中查找它们。 以下是一些支持此功能的网站: tools.benramsey/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: tools.benramsey/md5/

MD5算法不可能被称为单向散列函数。请参阅: en.wikipedia/wiki/MD5 [ ^ ] It's not possible MD5 algorithm is known as one-way hashing function. Please, see this: en.wikipedia/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字符串

本文发布于:2023-10-22 22:48:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1518956.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!