0

I found this example on MSDN: How to Hash Passwords

And these are the .NET Crypto classes: HashAlgorithm Classes

As you can see, all (sub)classes are abstract. But the method signature in MSDN's code sample is built as:

string HashPassword(string clearData, string saltValue, HashAlgorithm hash)

So my question is, how can I use this code e.g. using MD5 Hashing Algorithm?

A.B.
  • 2,374
  • 3
  • 24
  • 40

1 Answers1

1

You can use the implementation in the MD5CryptoServiceProvider class (this one is not abstract):

https://msdn.microsoft.com/en-us/library/system.security.cryptography.md5cryptoserviceprovider(v=vs.110).aspx

You can instantiate it and pass as the HashAlgorithm parameter of the HashPassword function of your sample.