Property MaxKeyDerivationSpinCount
MaxKeyDerivationSpinCount
Gets or sets the largest key-derivation iteration count ("spin count") DocWright will honour from an encrypted document, or null for unlimited.
This is the one limit that is on by default
(DefaultMaxKeyDerivationSpinCount), because the value it caps is chosen
by whoever wrote the file. ECMA-376 agile encryption stores its spin count in the
plaintext EncryptionInfo descriptor, so a hostile document can simply ask for
ten million rounds of SHA-512 and be honoured — a denial of service that needs no
exploit, only a text editor. Every other limit here defaults to unlimited because its
worst case is bounded by input size; this one is not.
A document declaring more than the cap raises ResourceLimitExceededException before any hashing is done, so the cost of rejecting it does not depend on the value it asked for.
public int? MaxKeyDerivationSpinCount { get; set; }
Property Value
- int?
Exceptions
- ArgumentOutOfRangeException
The value is not positive.