Best Way to Generate Random Salt in C#?

2019-02-05 17:42发布

问题:

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

回答1:

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



回答2:

Enterprise Library should be able to create a random salt for you very effectively. Check it out here.