- Notifications
You must be signed in to change notification settings - Fork5.1k
Refactor Rfc2898DeriveBytes to support spans#71888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ghost commentedJul 9, 2022
Tagging subscribers to this area: @dotnet/area-system-security,@vcsjones Issue DetailsSince the managed I took this approach as an alternative to a pure one-shot managed PBKDF2 implementation to use as much existing, battle tested code as possible to increase the chances that it will be taken in time for .NET 7. I investigated using the native PBKDF2 capabilities for Android and determined that unfortunately Android's APIs are not suitable for our needs for two reasons. First, it requires API Level 26 for SHA2 PBKDF2, which means we would still need the managed fallback since we support older Android versions. Second, it operates entirely on
|
...ibraries/System.Security.Cryptography/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
WASM failures are#71986. Merging. |
...ibraries/System.Security.Cryptography/src/System/Security/Cryptography/Rfc2898DeriveBytes.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Since the managed
Rfc2898DeriveBytes
is used to implement the one-shots on some platforms, this changes the internals of it to better support spans.I took this approach as an alternative to a pure one-shot managed PBKDF2 implementation to use as much existing, battle tested code as possible to increase the chances that it will be taken in time for .NET 7.
I investigated using the native PBKDF2 capabilities for Android and determined that unfortunately Android's APIs are not suitable for our needs for two reasons. First, it requires API Level 26 for SHA2 PBKDF2, which means we would still need the managed fallback since we support older Android versions. Second, it operates entirely on
Char[]
passwords, notByte[]
. We can't feed arbitrary bytes in to Java character arrays.