You have a task
Each guide is one situation, its code and its pitfalls.
ISecureRandom makes keys, tokens and values with an SP 800-90A generator seeded by the operating system and reseeded with every verified pulse from CURBy, NIST and drand. A draw from one pulse can be recomputed by anyone, and every sample on this site is a test.
A beacon's bytes never become a secret on their own, and no random value waits on the network.
dotnet add package NCode.Randomnessdotnet add package NCode.Randomness.Curbydotnet add package NCode.Randomness.Nistdotnet add package NCode.Randomness.DrandYou have a task
Each guide is one situation, its code and its pitfalls.
You are choosing an API
You want the rules
One registration adds the generator and three beacons, and one ISecureRandom makes a secret.
var builder = Host.CreateApplicationBuilder(args);var configuration = builder.Configuration;var randomness = configuration.GetSection(RandomnessOptions.SectionName);var curby = configuration.GetSection(CurbyBeaconOptions.SectionName);var nist = configuration.GetSection(NistBeaconOptions.SectionName);var drand = configuration.GetSection(DrandBeaconOptions.SectionName);builder .Services.AddRandomness(randomness) .AddCurbyBeacon(curby) .AddNistBeacon(nist) .AddDrandBeacon(drand);builder.Services.AddHealthChecks().AddRandomnessBeacons("ready");The drawing above is this flow: each beacon’s pulse is verified and mixed into the generator in the background, and the secret you make never waits on any of them.
It does
ncode-randomness-draw/1.It does not
GetBytes returns. Make a secretEach guide is one situation, its code and its pitfalls.
Not sure which API you need? Which API? asks a few questions and names one.
NCode.Randomness, with the generator and the draws, and NCode.Randomness.Curby,
NCode.Randomness.Nist and NCode.Randomness.Drand, one adapter for each beacon.net10.0, which the badge shows and
nuget.org lists.