Database and password encrypting

I have a project that will verify login credentials from a database table containing UserID's and passwords. the application will also create them and store them into the database. my first question is, what is the best way to encrypt the passwords and, how can I code this if it's not a simple explaination and someone has a URL to explain this please include it here.

Thanks.



Answer this question

Database and password encrypting

  • Symon Buck

    ToString can take a format string, which will alter the result. x gives a hexadecimal result, and x2 gives a 2 digit hex result, so you get a leading 0 for the first 15 (0xf ) values.



  • Balthazarkitty

    http://www.kbcafe.com/iBLOGthere4iM/ guid=20040923142406

    That's one example of how to use MD5 to hash a string. Basically, if your password checking code applies the MD5 hash to the password that is entered, then you can compare it to the MD5 value in your database, and the actual password is never stored anywhere.

    I believe MD5 is not overly secure nowadays, but it's still going to beat a lot of people who would have no trouble if they saw the actual password.



  • Yi Fang

    Sounds good. thanks for the explaination and your assistance.
  • Z.z.

    It will at least give me a start. I noticed that in that example it gives a section that has the following:

    s.Append(b.ToString("x2").ToLower());

    I was wondering that the "x2" does.

    Thank you for your assistance.


  • Database and password encrypting