Skip to content

Conversation

@vcsjones
Copy link
Member

@vcsjones vcsjones commented Jan 1, 2026

BCryptDeriveKeyPBKDF2 is only used on Windows 7, which is now totally unsupported.

Contributes to #71075.

BCryptDeriveKeyPBKDF2 is only used on Windows 7, which is now totally unsupported.
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes support for BCryptDeriveKeyPBKDF2, which was only used on Windows 7 (now unsupported). The implementation now exclusively uses BCryptKeyDerivation, which has been available since Windows 8 and offers better performance.

Key changes:

  • Removed conditional logic that selected between BCryptDeriveKeyPBKDF2 (Windows 7) and BCryptKeyDerivation (Windows 8+)
  • Eliminated the FillDeriveKeyPBKDF2 method entirely
  • Removed the BCryptDeriveKeyPBKDF2 P/Invoke interop definition

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Pbkdf2Implementation.Windows.cs Removed Windows 7 compatibility code path, version check, and FillDeriveKeyPBKDF2 method; simplified to always use FillKeyDerivation
System.Security.Cryptography.csproj Removed compilation reference to the BCryptDeriveKeyPBKDF2 interop file
Interop.BCryptDeriveKeyPBKDF2.cs Deleted the P/Invoke definition file that is no longer needed

The changes are clean and complete. All references to the removed functionality have been eliminated from the codebase, and the simplified code path now directly calls FillKeyDerivation which uses BCryptKeyDerivation. There is one informational comment in a test file (Rfc2898Tests.cs line 551) that mentions BCryptDeriveKeyPBKDF2, but this is just documenting the source of a test vector and does not need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant