TrulyRandom 0.7.1

.NET 5.0
dotnet add package TrulyRandom --version 0.7.1
NuGet\Install-Package TrulyRandom -Version 0.7.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TrulyRandom" Version="0.7.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TrulyRandom --version 0.7.1
#r "nuget: TrulyRandom, 0.7.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TrulyRandom as a Cake Addin
#addin nuget:?package=TrulyRandom&version=0.7.1

// Install TrulyRandom as a Cake Tool
#tool nuget:?package=TrulyRandom&version=0.7.1


A powerful .NET library for generating and testing high-quality truly random data using consumer hardware (generation is available only for Windows). Includes easy-to-use implementation of the NIST SP 800-22 test library. No external dependencies.


The library allows developers to retrieve low-entropy data from microphones, cameras and user input (mouse and keyboard), process this low-entropy data into high-entropy using different randomness extractors, test it using a library of tests defined in NIST SP 800-22, store and retrieve it and finally use it to get random data of various types:

//Using camera as an entropy source
VideoSource source = new VideoSource();

//Creating extractors
DeflateExtractor deflateExtractor = new DeflateExtractor();
ShuffleExtractor shuffleExtractor = new ShuffleExtractor();
HashExtractor hashExtractor = new HashExtractor();

//Creating tester
Tester tester = new Tester();

//Creating buffer
Buffer buffer = new Buffer();

//Linking all the modules together

//Starting the chain

//Waiting for data to collect
while (buffer.BytesInBuffer < 1000)

//Using the data
int result = buffer.DataSource.GetInt();

Library can be simply used to test user data with test functions defined in NIST SP 800-22:

if (TrulyRandom.NistTests.Frequency(userData).PValues[0] > 0.01)

And finally it provides a number of additional features:

  1. Sample application to ease the startup;
  2. Creation of the detailed test reports;
  3. Long-term evaluation of the generator quality;
  4. Automatic dumping of the exccess random data to the disk and retrieval from it when required;
  5. Automatic test parameter selection in accordance to NIST SP 800-22;
  6. Extractor seeding;
  7. Dynamic compression adjustment depending on the output buffer state;
  8. Module statistics: throughput in bytes per second, enthropy level, success rate, etc.;
  9. Device autoselection for video and audio sources;
  10. Still image detection;
  11. Generation of different types of random data from the collected entropy;
  12. Additional utilites like random array shuffle.
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.7.1 439 3/8/2022
0.7.0 384 3/7/2022