2012-11-23 17 views
0

可能重复:
What is the optimal length for user password salt?我应该在CreateSalt类中使用多大的尺寸?

我应该在CreateSalt类使用什么尺寸?

private static string CreateSalt(int size) 
+0

它看起来像一个方法,而不是一个类。 –

+2

可能duplciate:http://stackoverflow.com/questions/184112/what-is-the-optimal-length-for-user-password-salt – Andy

+0

堆栈溢出[使用16字节盐](http://代码。 google.com/p/stackid/source/browse/OpenIdProvider/Current.cs#384) –

回答

1

说完刚做完本周同样的事情,我决定一个字节[8]在.NET 4由RNGCryptoServiceProvider类生成

盐似乎是一个体面的大小,以避免碰撞与其他盐。

Si

+0

非常感谢! –