Edit:
See Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider for an example implementation. The steps of the step are:
- If SaltEnabled, generate random bytes for salt length using RNGCryptoServiceProvider.
- Add salt to clear text.
- Hash salty plain text.
- ( ) .
:
public bool CompareHash(byte[] plaintext, byte[] hashedtext)
. , , .
CompareHash :
- - -. , 4 .
- .
- hashedtext . - true, else false.
:
", HashProvider, , . unhashed, unhashed ."
" -, . .
, , unhashed-value , . "
http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=10284