Q: login screen

G

Guest

Hello,
Can anyone give me a link (C#) that handle login screen while keeping
username and password encrypted in the SQL Server?
Thanks,
Jim.
 
G

Guest

You can store the password in md5 format in the database and when the
password is entered, you can convert it to md5 and compare to the md5
password in the database.

use this method to convert a string to md5:

public static string GetMD5HashForString(string value)
{
if (value == null)
throw new ArgumentNullException("The 'value' parameter cannot be null.");

ASCIIEncoding ae = new ASCIIEncoding();
byte[] stringAsBytes = ae.GetBytes(value);
byte[] hash = new MD5CryptoServiceProvider().ComputeHash(stringAsBytes);

// Convert the byte array to a printable string.
StringBuilder sb = new StringBuilder(32);
foreach (byte hex in hash)
sb.Append(hex.ToString("X2"));

return sb.ToString().ToUpper();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top