You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 17, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 17, 2018. It is now read-only.
Move KeyDerivation to use the built in Rfc2989 SHA2* support in Core 2.0 #272
Looks like a good opportunity to delete code (a favorite pastime). Before we do, however, we should ensure we don't regress behavior by checking our test coverage.
Use caution that you don't cause a perf regression when you do this. The code as currently written determines which platform it is running on and calls into the fastest implementation for the platform. This is especially important when we're talking about password hashing, which defaults to 10,000 iterations. You probably don't want to take the CPU cost of 10,000 p/invoke calls in a tight loop if you can get away with just one. (Of course, this all depends on how the Rfc2898DeriveBytes class is written.)
@blowdart that would be ideal since you could bring the perf gains to the core class. It looks like Rfc2898DeriveBytes has some custom caching logic for results so you'd have to make sure that you don't break the scenario where somebody calls GetBytes multiple times.
Apparently there are quite a few performance improvements in there, last time I checked against the vanilla implementation (modified to support SHA512) on netfx, the dataprotection version was pretty much twice as fast.
Activity
natemcmaster commentedon Sep 1, 2017
Looks like a good opportunity to delete code (a favorite pastime). Before we do, however, we should ensure we don't regress behavior by checking our test coverage.
GrabYourPitchforks commentedon Sep 28, 2017
Use caution that you don't cause a perf regression when you do this. The code as currently written determines which platform it is running on and calls into the fastest implementation for the platform. This is especially important when we're talking about password hashing, which defaults to 10,000 iterations. You probably don't want to take the CPU cost of 10,000 p/invoke calls in a tight loop if you can get away with just one. (Of course, this all depends on how the Rfc2898DeriveBytes class is written.)
blowdart commentedon Oct 13, 2017
@GrabYourPitchforks do you think we should do this the other way around, and move the data protection version to core?
GrabYourPitchforks commentedon Oct 13, 2017
@blowdart that would be ideal since you could bring the perf gains to the core class. It looks like
Rfc2898DeriveByteshas some custom caching logic for results so you'd have to make sure that you don't break the scenario where somebody callsGetBytesmultiple times.Tornhoof commentedon Oct 19, 2017
Atleast on my Windows machine, the Dataprotection version is still ~25% faster than the pbkdf2 version from .NET Core:
Apparently there are quite a few performance improvements in there, last time I checked against the vanilla implementation (modified to support SHA512) on netfx, the dataprotection version was pretty much twice as fast.
As for source:
natemcmaster commentedon Oct 20, 2017
Thanks for the numbers. I'll take a look at these more closely before we change implementations.
aspnet-hello commentedon Jan 1, 2018
This issue was moved to dotnet/aspnetcore#2508