Skip to content

Update Rfc2898DeriveBytes Example Code #10011

@StefanGreve

Description

@StefanGreve

The example code for the Rfc2898DeriveBytes class uses the RNGCryptoServiceProvider for creating random bytes, but the documentation also states that

RNGCryptoServiceProvider is obsolete. To generate a random number, use one of the RandomNumberGenerator static methods instead.

Since this part of the documentation is related to cryptographic code, an effort should be made to keep the examples in the documentation up-to-date, since many developers might just copy and paste these code snippets.

The obsoletion warning for RNGCryptoServiceProvider only applies to .NET, so I am not sure if this would also affect the .NET framework / standard documentation as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.SecurityIssues related to security practices for .NET developers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions