C#


ROSLYN.SECURITY.CA5379 : Ensure Key Derivation Function algorithm is sufficiently strong (C#)

See Roslyn-Detected C# Warning Classes for more information.

Summary

Some implementations of the Rfc2898DeriveBytes class allow for a hash algorithm to be specified in a constructor parameter or overwritten in the HashAlgorithm property. If a hash algorithm is specified, then it should be SHA-256 or higher.

This check corresponds to Roslyn rule CA5379. For full rule details, see the Microsoft website: CA5379.

Properties

Class Name Ensure Key Derivation Function algorithm is sufficiently strong (C#)
Significance security
Mnemonic ROSLYN.SECURITY.CA5379
Categories None
Availability Available for C# only.
Enabling Checks for this warning class are enabled by default. To disable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Ensure Key Derivation Function algorithm is sufficiently strong (C#)"

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.