Hi
I'm using the following C# code to hash a password before it is stored in a database.
When someone logs in I hash the password entered and compare against the stored hashed password.Code:public static string Encrypt(string cleanString) { Byte[] clearBytes = new UnicodeEncoding().GetBytes(cleanString); Byte[] hashedBytes = ((HashAlgorithm) CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes); return BitConverter.ToString(hashedBytes); }
Now this seems to work in most cases but every so often the hashed passwords don't match!
Just wondering if there is a salt or anything similar that might be setup somewhere e.g. machine.config.
This is all on a shared server so it is possible the host is changing something somewhere that I don't know about.
Help!
DJ





Reply With Quote