get md5

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
 
E

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top