问题
Possible Duplicate:
Is it possible to decrypt md5 hashes?
I hashed data with ComputeHash
how can I learn original data from hashed data?
private void btn_Hash_Click(object sender, EventArgs e)
{
HashAlgorithm ha = HashAlgorithm.Create();
Stream file = new FileStream(@"C:\temp\simetrik.txt", FileMode.Open, FileAccess.Read);
hashClass.hash = ha.ComputeHash(file);
listBox1.Items.Add(BitConverter.ToString(hashClass.hash));
}
回答1:
You don't. The whole point of a cryptographic hash is that it's supposed to be computationally infeasible to reverse in general. The best you can do is check known dictionaries and rainbow tables. Neither of these will help much for unique plaintext. Perhaps you should be using an encryption algorithm instead.
Also, you should explicitly specify the algorithm you want. E.g.:
HashAlgorithm.Create("SHA1");
回答2:
You can't convert it back, hashing works only one way. The reason is that (1) it looses data - your hash uses much less memory than the original data. Think about string being hashed to int (2) many hashing algorithms are deliberately constructed in a way to make it computationally impossible to reverse them.
回答3:
The only way is to use a rainbow table, but I'm sure this is not exactly what you want. :)
来源:https://stackoverflow.com/questions/3289087/how-to-convert-hash-data-to-original-data