.NET: Difference between PasswordDeriveBytes and Rfc2898DeriveBytes

前端 未结 4 1212
时光说笑
时光说笑 2021-02-08 09:32

I\'m trying to understand some C#-code, I have been handed, which deals with cryptography, and specifically uses PasswordDeriveBytes from System.Security.Cryp

4条回答
  •  一向
    一向 (楼主)
    2021-02-08 10:11

    Here's a blog post detailing the differences:

    http://blogs.msdn.com/b/shawnfa/archive/2004/04/14/generating-a-key-from-a-password.aspx

    PBKDF2 can be used to generate keys of any length, which is very useful for password-based encryption (it can generate any key length as required by the symmetric cipher) but means less for secure password storage. It also applies the salt using HMAC instead of concatenation like PBKDF1, which has better security properties in cases of weak salts.

提交回复
热议问题