Looking for a method or to be pointed in the right direction so I can return an hash equal to the hash returned by FormsAuthentication.HashPasswordForStoringInConfigFile("asdf", "MD5"). I’ve been trying code like:
ASCIIEncoding encoding = new ASCIIEncoding();
encoding.GetBytes("asdf");
var hashedBytes = MD5.Create().ComputeHash(bytes);
var password = encoding.GetString(hashedBytes);
I’m not that strong on Hashing so I don’t know where to go next. I always end up with crazy special characters while the FormsAuth method always returns something readable.
Just trying to remove the external dependency to FormAuthentication from some internal business classes.
Here is the reflector’s output:
Your problem is not using UTF8
So here is your updated code: