Table of Contents

Interface IRandomSource

Namespace
DocWright.Cryptography
Assembly
DocWright.Cryptography.dll

The source of the salts, initialization vectors and keys an encryption pass needs.

This seam exists so tests can be deterministic. Everything else DocWright writes is byte-identical across runs; encryption cannot be, because reusing a salt would defeat it. Injecting the randomness moves that boundary somewhere a test can stand on rather than abandoning the guarantee.

A production caller should never supply one. A predictable implementation makes the output trivially breakable.

public interface IRandomSource

Methods

GetBytes(byte[])

Fills a buffer with random bytes.