تخطَّ إلى المحتوى

Weak PBKDF2 iterations (ARCH332)

هذا المحتوى غير متوفر بلغتك بعد.

Key dotnet.security.weak-pbkdf2-iterations · Severity warning · Category security · CWE CWE-916

Using a low iteration count for PBKDF2 reduces the computational cost of the derived key, making it easier for attackers to crack passwords with brute-force or dictionary attacks.

var hash = new Rfc2898DeriveBytes(
password, salt, 1000, HashAlgorithmName.SHA1).GetBytes(32);
var hash = new Rfc2898DeriveBytes(
password, salt, 100_000, HashAlgorithmName.SHA256).GetBytes(32);

Use at least 100,000 iterations and SHA-256 for PBKDF2, and raise the iteration count periodically as hardware improves.