Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Q: login screen (http://www.velocityreviews.com/forums/t104714-q-login-screen.html)

=?Utf-8?B?SklNLkgu?= 06-15-2005 12:18 PM

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

=?Utf-8?B?Q3JhaWc=?= 06-15-2005 01:14 PM

RE: Q: login screen
 
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(stringAsByt es);

// 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();
}



"JIM.H." wrote:

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



All times are GMT. The time now is 08:34 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.