Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am running a project in vs.net 2003 and in 2005, I am using the .gethashcode() to generate the hash value of my password which will be used in a comparison with the value stored in a database. However .gethashcode() from 2005 generates a totally different value from that of 2003. Has the hashing function been changed? and if so, how do I go about getting back the old hash values?

 

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 (edited)

The .GetHashCode inherited from System.Object isn't a cryptographically sound hashing routine and shouldn't be relied on for passwords etc. it is mainly used to determine the uniqueness of an object within the running application and most definitely not between executions and versions.

 

If you are wanting to use this for passwords or similar you should really be looking at one of the hashing classes under System.Security.Cryptography such as MD5 (although this has recently be found to have limitations) or one of the SHA variants.

Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
The .GetHashCode inherited from System.Object isn't a cryptographically sound hashing routine and shouldn't be relied on for passwords etc. it is mainly used to determine the uniqueness of an object within the running application and most definately not between executions and versions.

 

If you are wanting to use this for passwords or similar you should really be looking at one of the hashing classes under System.Security.Cryptography such as MD5 (although this has recently be found to have limitations) or or one of the SHA variants.

 

Hi PlausiblyDamp,

 

I have taken your suggestion regarding the SHA1, however it brings me back to the same problem as yesterday, in that once I have the hashed value in a byte array, how can I store that in a string? I have used (new unicoding).getString(byte() name).

 

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)

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...