Construct a de-salting SaltShaker¶
This operation builds a SaltShaker instance using the parameterless constructor, which leaves _dateParts as null and is only safe to use for BlandHash (OP-HU-04), never SaltHash. In-repo, SystemHashService.RemoveSystemHashSaltAndValidateLifetime is the sole caller.
| Field | Value |
|---|---|
| Operation ID | OP-HU-02 |
| Trigger | Caller needs to de-salt a hash (in-repo: SystemHashService.RemoveSystemHashSaltAndValidateLifetime) |
| Inputs | none |
| Outputs | SaltShaker instance with _random populated; _dateParts left null |
| Primary components | SaltShaker.SaltShaker() |
| Entry point | src/SAIF.NetCore.HashUtil/SAIF.NetCore.HashUtil/SaltShaker.cs |
Steps¶
- Create a new
System.Randominstance (BR-HU-04 — this instance is unusable forSaltHashbecause_datePartsis never populated).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller needs to de-salt a hash]) --> S1["Create System.Random;<br>_dateParts left null"]
S1 --> EndOk([Instance ready for BlandHash only])
Failure and edge-case behavior¶
- The resulting instance has a
null_dateParts; callingSaltHashon it throws an unguardedNullReferenceExceptionbecauseSaltHashiterates_datePartsdirectly (BR-HU-04).
Related documentation¶
Sources¶
src/SAIF.NetCore.HashUtil/SAIF.NetCore.HashUtil/SaltShaker.cssrc/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash/SystemHashService.cs