Mono Class Library: System.Security.Cryptography.PasswordDeriveBytes Overview | MembersSystem.Security.Cryptography.PasswordDeriveBytes.GetBytes Method |
Request a buffer of derived bytes from the algorithm. [Edit]
|
- cb
- The length of derived bytes requested. [Edit]
An array of the specified length contaning bytes derived of the secret password and other (possibly public) informations. [Edit]
SECURITY WARNING: You should never ask for more bytes than the PasswordDeriveBytes.HashName digest algorithm can provide (e.g. 20 bytes maximum for SHA-1). This is the maximum you can get securely (i.e. don't try to get a 256 bits key using SHA-1). The PKCS#5 specification dictates to return an error if more is asked, however MS implementation does support it.
INTEROPERABILITY WARNING: The previous undocumented behaviour isn't 100% compatible between Mono and MS implementation and should be avoided when possible. If it cannot be avoided try to call GetBytes once then split the bytes amongst multiple variables (e.g. key, iv) if required. This seems to be the safest way to interoperate between the two implementations.
[Edit]
Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0