Best Way to Generate Random Salt in C#?

Petey B picture Petey B · Jun 20, 2011 · Viewed 18.7k times · Source

Question says it all, what is the best method of generating a random salt (to be used with a hash function) in C#?

Answer

SLaks picture SLaks · Jun 20, 2011

You should use the RNGCryptoServiceProvider class to generate cryptographically secure random numbers..