[Breaking change]: Rfc2898DeriveBytes constructors are obsolete in .NET 10 #44500
Labels
breaking-change
Indicates a .NET Core breaking change
🏁 Release: .NET 10
Work items for the .NET 10 release
Description
Starting in .NET 10, all of the constructors on
Rfc2898DeriveBytes
are obsolete.Version
.NET 10 Preview 1
Previous behavior
The
Rfc2898DeriveBytes
had constructors that were not obsolete, or obsolete under a different diagnostic ID.New behavior
The
Rfc2898DeriveBytes
constructors are obsolete with SYSLIB0060 diagnostic ID and messageType of breaking change
Reason for change
The instance-based implementation of PBKDF2, which
Rfc2898DeriveBytes
provides, offers a non-standard usage by "streaming" bytes back by allowing successive calls toGetBytes
. This is not the intended use of PBKDF2, the algorithm should be used as a one-shot. The one-shot functionality exists as the static methodRfc2898DeriveBytes.Pbkdf2
and should be used instead of instantiatingRfc2898DeriveBytes
.Recommended action
Change instances of
Rfc2898DeriveBytes
and calls toGetBytes
to use thePkbdf2
one-shot static method instead.For example, change:
to
Feature area
Cryptography
Affected APIs
The text was updated successfully, but these errors were encountered: