ChaosForge 1.0.0

dotnet add package ChaosForge --version 1.0.0
                    
NuGet\Install-Package ChaosForge -Version 1.0.0
                    
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="ChaosForge" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChaosForge" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ChaosForge" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ChaosForge --version 1.0.0
                    
#r "nuget: ChaosForge, 1.0.0"
                    
#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.
#:package ChaosForge@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ChaosForge&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ChaosForge&version=1.0.0
                    
Install as a Cake Tool

ChaosForge

A high-entropy cryptographic random number generator for .NET that combines entropy pooling, SHA-256 whitening, and counter-driven output generation.

Overview

ChaosForge provides a SecureRandomEngine that collects entropy from multiple system-level sources and uses advanced techniques to produce high-quality random data suitable for cryptographic and security-sensitive applications.

Features

  • Multi-source entropy collection: Gathers unpredictable data from timing jitter, thread scheduling, garbage collection timing, GUID generation, and OS cryptographic providers
  • SHA-256 whitening: Ensures uniform distribution of random output
  • Periodic reseeding: Automatically reseeds every 1024 operations for enhanced security
  • Counter-mode generation: Uses an incrementing counter to produce unique output blocks
  • Statistical validation: Includes test utilities for randomness quality assessment

Installation

dotnet add package ChaosForge

Usage

Basic Usage

using ChaosForge;

var rng = new SecureRandomEngine();

// Generate random bytes
byte[] randomData = rng.NextBytes(32);

// Generate random integers
int randomInt = rng.NextInt();

// Generate random double (0.0 to 1.0)
double randomDouble = rng.NextDouble();

// Manually reseed for additional entropy
rng.Reseed();

Statistical Testing

The ChaosAudit module provides randomness quality tests:

using ChaosAudit;

byte[] data = rng.NextBytes(1_000_000);

// Frequency test
var freqTest = RandomTester.FrequencyTest(data);
Console.WriteLine($"1s Ratio: {freqTest.Ratio}");

// Byte distribution test
var distTest = RandomTester.ByteDistributionTest(data);
Console.WriteLine($"Chi-Square: {distTest.ChiSquare}");

// Serial correlation test
var corrTest = RandomTester.SerialCorrelationTest(data);
Console.WriteLine($"Correlation: {corrTest.Correlation}");

Project Structure

  • ChaosForge: Core library containing the random engine and entropy collection
  • ChaosForge.Example: Sample application demonstrating usage and statistical validation
  • ChaosAudit: Testing utilities for randomness quality assessment

Requirements

  • .NET 6.0 or higher
  • Supports multiple .NET versions (net6.0, net8.0, net9.0, net10.0)

Security Considerations

While ChaosForge provides high-entropy random generation, ensure it meets your specific security requirements before using in production systems. Always validate randomness quality for your use case.

License

MIT License

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  net8.0-android was computed.  net8.0-browser 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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.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
1.0.0 105 5/15/2026