Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi

 

I use the command .GetHashCode() to generate a hash value for my users passwords, which is then compared against a hash code stored in a database when logging my users in. I have a forgot password option, which allows the user to submit their username and their email address, which then generates a new password and emails the value to the user. The procedure also updates the database with the new password. I need to get a hash code value of the new password in sql server as I do not want to return the new password to my vb.net app and hash the password and call a new database procedure.

 

Therefore, does sql server 2005 have some sort of hash function? Or is there an alternative means of generating a new password for my user?

 

Mike55.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

  • Administrators
Posted

.GetHashCode() doesn't perform a hash of the value - you need to use one of the classes under System.Security.Cryptography instead.

 

Why do you not get the vb app to generate the new password, hash it and then send that hash to SQL rather than requiring SQL to perform the hash?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

Yea, I think that that is the most effective way to proceed.

 

Thanks PlausiblyDamp.

 

Mike55.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

  • Leaders
Posted
Either way, a standard hashing algorithm would be best, such as MD5. If you have to do hashing on both ends you know the result will be the same in both places.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...