title: .NET: Difference between PasswordDeriveBytes and Rfc2898DeriveBytes
body: <p>I'm trying to understand some C#-code, I have been handed, which deals with cryptography, and specifically uses <code>PasswordDeriveBytes</code> from <code>System.Security.Cryptography</code>.</p>
  
  <p>In the <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.passwordderivebytes.aspx">.NET docs</a> , it says that <code>PasswordDeriveBytes</code> uses "an extension of the PBKDF1 algorithm" which is later in the document specified as "the PKCS#5 v2.0 standard", which is PBKDF2 (as far as I can tell). Everywhere on the net I've found (including here on Stack Exchange), though, everyone says "use Rfc2898DeriveBytes, cause Password* is deprecated and uses PBKDF1". But the only difference in the docs at <a href="http://msdn.microsoft.com">msdn.microsoft.com</a> seems to be that the Rfc*-version specifically mentions PBKDF2, where Password* says "extension of PBKDF1" and "PKCS#5 v 2.0". </p>
  
  <p>So, can anyone tell me what the difference is between the two classes (if any) and why I should use one rather than the other for PBKDF2 password key derivation?</p>
  
  <p>Now, other code, that deals with the same data, explicitly uses PBKDF2, and works, so that would suggest that indeed <code>PasswordDeriveBytes</code> also uses PBKDF2, or that PBKDF2 is simply compatible with PBKDF1 under certain circumstances, but I want to know for sure that it's not some side effect of some random thing, and that things just magically works (and eventually probably will magically and spectacularly break) without anyone really understanding why.</p>