HighTechTalks DotNet Forums  

[c#] GetHashCode() + Upgrade to asp.net 2.0

Dotnet Security microsoft.public.dotnet.security


Discuss [c#] GetHashCode() + Upgrade to asp.net 2.0 in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?Rk0=?=
 
Posts: n/a

Default [c#] GetHashCode() + Upgrade to asp.net 2.0 - 07-20-2007 , 03:58 AM






Hello,

I have an application compiled under aspnet 1.1. when I run this under IIS
with asp.net 2.0, users cannot login. This is because the
GetHashCode()-function returns another value.

Is there a way to fix this?

thx!

Reply With Quote
  #2  
Old   
Joe Kaplan
 
Posts: n/a

Default Re: [c#] GetHashCode() + Upgrade to asp.net 2.0 - 07-20-2007 , 10:42 AM






I think you might want to consider using an actual cryptographic hash
function. GetHashCode is intended for making it easy to insert things in a
HashTable but it isn't intended for cryptographic purposes.

You should be using something like SHA1 for generating hashes for a logon
algorithm. SHA1 (or other crypto has algs) called the same way will return
the same value for the same inputs regardless of platform.

As to whether the underlying implementation of GetHashCode may have changed,
that may be true. I think I remember hearing something about that.
However, my understanding was that you were never supposed to depend on a
specific value being returned in the first place.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"FM" <FM (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello,

I have an application compiled under aspnet 1.1. when I run this under
IIS
with asp.net 2.0, users cannot login. This is because the
GetHashCode()-function returns another value.

Is there a way to fix this?

thx!



Reply With Quote
  #3  
Old   
Joe Kaplan
 
Posts: n/a

Default Re: [c#] GetHashCode() + Upgrade to asp.net 2.0 - 07-20-2007 , 10:42 AM



I think you might want to consider using an actual cryptographic hash
function. GetHashCode is intended for making it easy to insert things in a
HashTable but it isn't intended for cryptographic purposes.

You should be using something like SHA1 for generating hashes for a logon
algorithm. SHA1 (or other crypto has algs) called the same way will return
the same value for the same inputs regardless of platform.

As to whether the underlying implementation of GetHashCode may have changed,
that may be true. I think I remember hearing something about that.
However, my understanding was that you were never supposed to depend on a
specific value being returned in the first place.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"FM" <FM (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello,

I have an application compiled under aspnet 1.1. when I run this under
IIS
with asp.net 2.0, users cannot login. This is because the
GetHashCode()-function returns another value.

Is there a way to fix this?

thx!



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.