I have used GetHashCode() to encrypt password field.
When new user is created the password entered by user is stored in hascode value like
string pswd = txtPassword.text.GetHashCode();
then this pswd string is stored in database. After that when user login to his account then again I convert user's entered value in hascode value like
string userPassword = txtEnterPassword.text.GetHashcode();
Then I check the value of the password saved in database and user's text is matching or not. This working fine in my development server.
But when I uploaded this page in live server it's not working. When user create new account and after that he try to login with his correct password he cannot login to the page.
I searched the solution in msdn then I readed this line: 'The default implementation of the GetHashCode method does not guarantee unique return values for different objects.' What I should to do now. Please anyone have any idea?
Loading
Abhimanyu K VatsaPosted Oct 12, 2012, 5:52 AM
On MSDN:
The default implementation of the GetHashCode method does not guarantee unique return values for different objects. Furthermore, the .NET Framework does not guarantee the default implementation of the GetHashCode method, and the value it returns will be the same between different versions of the .NET Framework. Consequently, the default implementation of this method must not be used as a unique object identifier for hashing purposes.
Recommendation: Use other approaches.
Dinesh AmbaliyaPosted Oct 12, 2012, 9:37 AM
Shivanand ArurPosted Oct 12, 2012, 5:32 AM
Thank you,
Shivanand Arur.
Shivanand ArurPosted Oct 12, 2012, 5:24 AM
But still try consulting from some other Senior members of this community... I'll forward this thread to some Experts... Let's see what they say!!!
Cheers!!!
Dinesh AmbaliyaPosted Oct 10, 2012, 8:39 AM
When I run this page using VS built in server it run as I intended but after uploading the site in production server User's entered password and database value doesn't match. So is there any mistake in configuration in production server?
Shivanand ArurPosted Oct 10, 2012, 8:01 AM
Try using some encryption/decryption techniques. There are various classes available in .Net for encryption. This will help you to keep your passwords safe.
Hope it helps you!!!
@Dinesh - PLEASE MARK THE ANSWER AS ACCEPTED IF IT HELPED!!!
Thanks!!!