Quote:
Originally Posted by steve@dvdlard
Bit of a long shot but does anyone know If I can reproduce the password in VB.Net. I'm trying to create a 'Post a Comment' link on another site which is .Net, tried all sorts of variations of MD5 but the resulting hash code is never the same as the database.
|
rarrrr. Zombie thread! Probably too late to help you, but hopefully others will find it while searching.
I was having this exact same problem because .net's inbuilt FormsAuthPasswordFormat doesn't work the same as php. The following crappy snippet I came up with works for me with 3.6.0 and salted passwords.
Code:
ASCIIEncoding ae = new ASCIIEncoding();
MD5 md5 = new MD5CryptoServiceProvider();
byte[] data = new byte[ae.GetByteCount(str)];
byte[] result = md5.ComputeHash(ae.GetBytes(str));
password = "";
for (int i=0; i<result.Length;i++)
{
password += (Uri.HexEscape(Convert.ToChar(result[i]))).Remove(0,1).ToLower();
}