WriteProtection.Salt Property

Definition

Salt for Password Verifier

Represents the following attribute in the schema: w:salt

C#
[DocumentFormat.OpenXml.SchemaAttr(23, "salt")]
public DocumentFormat.OpenXml.Base64BinaryValue Salt { get; set; }
C#
public DocumentFormat.OpenXml.Base64BinaryValue Salt { get; set; }
C#
[DocumentFormat.OpenXml.SchemaAttr(23, "salt")]
public DocumentFormat.OpenXml.Base64BinaryValue? Salt { get; set; }
C#
[DocumentFormat.OpenXml.SchemaAttr("w:salt")]
public DocumentFormat.OpenXml.Base64BinaryValue? Salt { get; set; }
C#
public DocumentFormat.OpenXml.Base64BinaryValue? Salt { get; set; }

Property Value

Returns StringValue.

Attributes

Remarks

The following information from the ECMA International Standard ECMA-376 can be useful when working with this class.

Specifies the salt which was prepended to the user-supplied password before it was hashed using the hashing algorithm defined by the preceding attribute values to generate the hash attribute, and which shall also be prepended to the user-supplied password before attempting to generate a hash value for comparison. A salt is a random string which is added to a user-supplied password before it is hashed in order to prevent a malicious party from pre-calculating all possible password/hash combinations and simply using those precalculated values (often referred to as a dictionary attack).

If this attribute is omitted, then no salt shall be prepended to the user-supplied password before it is hashed for comparison with the stored hash value.

Consider a WordprocessingML document with the following information stored in one of its protection elements:

<w:… w:salt="ZUdHa+D8F/OAKP3I7ssUnQ=="  
  w:hash="9oN7nWkCAyEZib1RomSJTjmPpCY=" />  

The salt attribute value of ZUdHa+D8F/OAKP3I7ssUnQ== specifies that the user-supplied password shall have this value prepended before it is run through the specified hashing algorithm to generate a resulting hash value for comparison.

The possible values for this attribute are defined by the XML Schema base64Binary data type.

Applies to

Product Versions
DocumentFormat.OpenXml 2.7.1, 2.7.2, 2.8.0, 2.8.1, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.12.0, 2.12.1, 2.12.2, 2.12.3, 2.13.0, 2.13.1, 2.14.0, 2.15.0, 2.16.0, 2.17.1, 2.18.0, 2.19.0, 2.20.0, 3.0.0, 3.0.1