Q: login screen

Discussion in 'ASP .Net' started by =?Utf-8?B?SklNLkgu?=, Jun 15, 2005.

  1. 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?SklNLkgu?=, Jun 15, 2005
    #1
    1. Advertising

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



    "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.
     
    =?Utf-8?B?Q3JhaWc=?=, Jun 15, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Russell
    Replies:
    1
    Views:
    377
    Steve C. Orr [MVP, MCSD]
    Jan 21, 2004
  2. Pat
    Replies:
    5
    Views:
    543
  3. owl
    Replies:
    2
    Views:
    881
  4. Biranchi Narayan Panda
    Replies:
    1
    Views:
    2,751
    Alexey Smirnov
    Feb 17, 2010
  5. Colin Graham

    Login to admin system through login screen only

    Colin Graham, Apr 10, 2005, in forum: ASP .Net Security
    Replies:
    1
    Views:
    251
    Joseph MCAD
    Apr 11, 2005
Loading...

Share This Page