get md5

  • Thread starter Thread starter erdem
  • Start date Start date
E

erdem

hi,
i have 2 different applications. (1 is WEb application (asp.net), other
is windows forms app.)

Web application saves user information (username, pass) to database for
a while, using HashPasswordForStoringInConfigFile method (using MD5).

i want to use this same information in windows forms app. so that users
can log in with their current user/pass.
But i cant use HashPasswordForStoringInConfigFile method to get hash of
password.

i tried

System.Security.Cryptography.MD5CryptoServiceProvider oMD5Hasher
= new System.Security.Cryptography.MD5CryptoServiceProvider();
System.Text.Encoding enc= System.Text.Encoding.ASCII;
string hashedpass =
BitConverter.ToString(oMD5Hasher.ComputeHash(enc.GetBytes(txtPass.Text)));

but this does not get same hash for same password string.

How can i get md5 hash of file so that produced hash will be same as
HashPasswordForStoringInConfigFile method from windows forms without
using HashPasswordForStoringInConfigFile method.


Regards

Erdem
 
erdem said:
hi,
i have 2 different applications. (1 is WEb application (asp.net), other
is windows forms app.)

Web application saves user information (username, pass) to database for
a while, using HashPasswordForStoringInConfigFile method (using MD5).

i want to use this same information in windows forms app. so that users
can log in with their current user/pass.
But i cant use HashPasswordForStoringInConfigFile method to get hash of
password.

i tried

System.Security.Cryptography.MD5CryptoServiceProvider oMD5Hasher
= new
System.Security.Cryptography.MD5CryptoServiceProvider();
System.Text.Encoding enc= System.Text.Encoding.ASCII;
string hashedpass =
BitConverter.ToString(oMD5Hasher.ComputeHash(enc.GetBytes(txtPass.Text)));

but this does not get same hash for same password string.

How can i get md5 hash of file so that produced hash will be same as
HashPasswordForStoringInConfigFile method from windows forms without
using HashPasswordForStoringInConfigFile method.


Regards

Erdem
My mistake

Web app was using SHA1 encryption
sorry

Erdem
 
Back
Top