PasswordDeriveBytes.Salt Property

Definition

Gets or sets the key salt value for the operation.

C#
public byte[]? Salt { get; set; }
C#
public byte[] Salt { get; set; }

Property Value

Byte[]

The key salt value for the operation.

Exceptions

The key salt value is fixed and an attempt is made to change this value.

Remarks

A dictionary attack is an attack in which the attacker attempts to decrypt an encrypted message by comparing the encrypted value with previously computed encrypted values for the most likely keys. This attack is made much more difficult by the introduction of random bytes at the end of the password before the key derivation. These random bytes are known as salt.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also