<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0" />

Org.BouncyCastle.Security.SecureRandom

public class SecureRandom : Random
protected readonly IRandomGenerator generator

public SecureRandom()

public SecureRandom(IRandomGenerator generator)

Use the specified instance of IRandomGenerator as random source.

public SecureRandom(IRandomGenerator generator, int autoSeedLengthInBytes)

public static void Fill(Span<byte> buffer, SecureRandom secureRandom)

public static SecureRandom GetInstance(string algorithm)

Create and auto-seed an instance based on the given algorithm.

public static SecureRandom GetInstance(string algorithm, bool autoSeed)

Create an instance based on the given algorithm, with optional auto-seeding

public static byte[] GetNextBytes(SecureRandom secureRandom, int length)

public virtual byte[] GenerateSeed(int length)

public virtual void GenerateSeed(Span<byte> seed)

public virtual void NextBytes(byte[] buf, int off, int len)

public virtual int NextInt()

public virtual long NextLong()

public virtual void SetSeed(byte[] seed)

public virtual void SetSeed(Span<byte> seed)

public virtual void SetSeed(long seed)