-5
byte[] pass = Encoding.Unicode.GetBytes(textBox1.Text);
MD5 md5 = new MD5CryptoServiceProvider();
String password = Encoding.UTF8.GetString(md5.ComputeHash(pass));

Do not modify the code, the code only increases
Decryption variable:password
Tried a lot of methods can not decrypt utf8 string to md5
password value is garbled, how to restore the password: md5?
textBox.text = wooyun
md5.ComputeHash(pass) = F04BC0C32584F9D42817DC6EF8769E9E
Encoding.UTF8.GetString(md5.ComputeHash(pass))=�K��%���(�n�v��

0x_Jin
  • 1
  • 1
  • You might want to expand out your question a bit more. It doesn't look like you put much work into it. If you aren't willing to put work into explaining and clarifying your question, how can you expect others to put work into answer your question? – Alex K Nov 25 '14 at 03:34
  • What does _decrypt utf8string to md5_ mean? UTF8 is not an encryption system and MD5 is a hash not an encryption, and can't be 'decrypted'. –  Nov 25 '14 at 03:35
  • Sorry, this description of the problem more clearly – 0x_Jin Nov 25 '14 at 03:57
  • You seem to be trying to decrypt a hash. As Hobo Sapiens said, that's impossible. Look at [this](https://en.wikipedia.org/wiki/Hash_function) – Diligent Key Presser Nov 25 '14 at 04:01
  • no,I do not need to decrypt the hash value, and I just get the password from the hash value – 0x_Jin Nov 25 '14 at 04:03
  • What `password` should look like? – Diligent Key Presser Nov 25 '14 at 04:08
  • Are you trying to get a string representation of the MD5 hash? That is, the string value `"F04BC0C32584F9D42817DC6EF8769E9E"'? Perhaps http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa will be of some use to you. – Jim Mischel Nov 25 '14 at 05:15
  • Looks like homework... – t3chb0t Nov 25 '14 at 06:22

1 Answers1

0

Please consult the services of a security expert instead of attempting to do whatever it is you are trying to do by yourself. In just these 3 example lines of code and without being an expert on security myself, I can already tell that:

  • you are conflating the ideas of encoding, encryption, and hashing
  • you are attempting to reverse-lookup a password from a stored hash, presumably from some existing database. In addition to most likely being malicious ethically, this could be illegal in some jurisdictions
  • the hashed password are likely not salted, therefore the stored passwords are susceptible to brute-force attacks
  • the hashes were generated with MD5, known to be a weak algorithm for password hashing

Is this exercise for learning purposes? Can you clarify the question?

F.Buster
  • 88
  • 7