Results 1 to 3 of 3

Thread: how does salting a md5 work on a data base

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    198

    how does salting a md5 work on a data base

    can someone tell me how salting works. i get stuck when adding more info to the data.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: how does salting a md5 work on a data base

    Assuming you are salting passwords:

    1. User registers and provides a password.
    2. You convert the password to binary form, i.e. a Byte array, using Encoding.GetBytes.
    3. You generate some random binary data, i.e. the salt, using an RNGCryptoServiceProvider.
    4. You append the salt to the binary password and hash it.
    5. You store the user's login name, hashed password and the salt in the database.
    6. When the user logs in you you retrieve the hashed password and the salt for the specified login name.
    7. You then convert the password used to login to binary, append the salt and hash the result.
    8. Finally, you compare the new hash with the hash in the database. If they match the user is authenticated, otherwise not.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    198

    Re: how does salting a md5 work on a data base

    oh. thanks. the tut i just read missed salting again before compareing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width