You missing something here...
You take your password, add some salt (maybe pepper and olive oil) to it, than crate its hash and store that in some database.
When want to check if the provided password is the same stored in the database you pass it through the same process - except the store part, and compare the result to the stored value...
This is the right process, and anyway you can not reverse this kind of hash to get the original value. For security reason in password storage you have to use a one-way-has (called also cryptographic hash), like SHA...
[EDIT]
Some code sample to get the idea...
private string CreateHash ( string Password )
{
string szBase = string.Format ( "code{0}project", Password );
SHA512 oSHA512 = SHA512.Create ( );
byte[ ] bResult = oSHA512.ComputeHash ( Encoding.UTF8.GetBytes ( szBase ) );
string szHash = Encoding.UTF8.GetString ( bResult );
return ( szHash );
}
public void StorePassword(string UserName, string Password)
{
string szHash = CreateHash ( Password );
DAL.StorePassword ( UserName, szHash );
}
public void ValidatePassword ( string UserName, string Password )
{
string szStoredHash = DAL.ReadPassword ( UserName );
string szHash = CreateHash ( Password );
if ( szHash.Equals ( szStoredHash ) )
{
}
else
{
}
}
[/EDIT]