Can you please give me the complete code. I'm getting error.
Dim Hashpass As String
Dim ByteArray() As Byte
TempCommand.CommandText = "SP_RecoverPassword"
If TempDataset.Tables(0).Rows.Count > 0 Then
ByteArray = TempDataset.Tables(0).Rows(0)("Password")
Hashpass = Convert.ToBase64String(ByteArray)
Hold on a minute! This is a fine example of why you should give a FULL and CLEAR explanation of the WHOLE problem in the first place. That means explaining what you're trying to achieve as well as how you're trying to achieve it. It appears to me that you are trying to provide a feature that will give the user their password if they've forgotten it. Is that the case? If so then forget it. The whole point of hashing is that it is one-way. The whole point of hashing is that you can NEVER determine what the original value was from the hash.
You're not listening. The fact that you think it could work or should work makes no difference. The reason that we can't convert a hash back to the original string is because that is exactly what hashing is for: to convert data to another value that cannot then be used to recreate the original data. Hashing exists specifically to prevent what you're trying to do. It is a one-way operation. That's it, that's all. If you want to be able to recreate the original data then you need to use encryption, not hashing.
MD5, SHA, CRC, are all one-way hashing algorithms. They only contain a fingerprint of the original data. The whole point is that if anyone gets a hold of the hash, it can never be reverted to plain text. With hashed passwords, the user enters a password, you hash it and compare the hash with the one you have stored. If they match the password was good. You should not try to give the users their password back, but you CAN let the user change his password if he has forgotten it. Verify some other info and let him change the password. This way if someone else changes it, the real user contacts you because he can't log on anymore.
Plain text passwords have been mostly extinct for the last 20 years.