
Open-source entropy harvesting from unconventional hardware sources. Rust + Python SDK.
One workflow for entropy research, validation, and cryptographic deployment.
By Amenti Labs
# Install
cargo install openentropy-cli
# Discover entropy sources on your machine
openentropy scan
# Benchmark all fast sources
openentropy bench
# Output 64 random hex bytes
openentropy stream --format hex --bytes 64
# Live TUI dashboard
openentropy monitor
By default, only fast sources (<2s) are used. Pass
--allto include slower sources (DNS, TCP, GPU, BLE). The positional aliasallis also accepted for compatibility.
Most OpenEntropy sources come from the host machine itself. OpenEntropy also supports external hardware devices when they are attached and discoverable:
qcicada source. OpenEntropy can read the device's quantum output and benchmark, analyze, record, or compare it alongside on-host sources. The device's own output modes map to raw, sha256, and samples, and OpenEntropy now uses QCicada's fresh-start continuous-mode helper from qcicada 0.2.2, so it discards already-buffered device input once after entering continuous mode instead of serving the first read from stale queued bytes. See the QCicada manual.pip install openentropy
from openentropy import EntropyPool, detect_available_sources
sources = detect_available_sources()
print(f"{len(sources)} entropy sources available")
pool = EntropyPool.auto()
source = sources[0]["name"]
data = pool.get_source_bytes(source, 256, conditioning="sha256")
Build from source (native extension):
git clone https://github.com/amenti-labs/openentropy.git && cd openentropy
pip install maturin
maturin develop
Security engineers use OpenEntropy to validate entropy quality and seed CSPRNGs:
openentropy analyze --profile security --output audit.md
Researchers use OpenEntropy to study raw noise characteristics:
openentropy analyze --profile deep --output analysis.json
Security engineers seed CSPRNGs, generate keys, and supplement /dev/urandom with independent hardware entropy. The SHA-256 conditioned output (--conditioning sha256, the default) produces cryptographic-quality random bytes. The security profile enables the NIST test battery, min-entropy breakdown, and SHA-256 conditioning in one flag.
Researchers study the raw noise characteristics of hardware subsystems. Pass --conditioning raw to get unwhitened, unconditioned bytes that preserve the actual noise signal from each source. The deep profile enables 100K samples, cross-correlation, and PEAR-style trial analysis.
Raw mode enables:
Most random number generators are pseudorandom — deterministic algorithms seeded once. OpenEntropy continuously harvests real physical noise from your hardware:
The pool XOR-combines independent streams. No single source failure can compromise the pool.
Conditioning is optional and configurable. Use --conditioning on the CLI or ?conditioning= on the HTTP API:
| Mode | Flag | Description |
|---|---|---|
| SHA-256 (default) | --conditioning sha256 | SHA-256 conditioning. Cryptographic quality output. |
| Von Neumann | --conditioning vonneumann | Debiasing only — removes bias while preserving more of the raw signal structure. |
| Raw | --conditioning raw | No processing. Source bytes with zero whitening — preserves the actual hardware noise signal for research. |
Raw mode is what makes OpenEntropy useful for research. Most HWRNG APIs run DRBG post-processing that makes every source look like uniform random bytes, destroying the information researchers need. Raw output preserves per-source noise structure: bias, autocorrelation, spectral features, and cross-source correlations. See Conditioning for details.
| Doc | Description |
|---|---|
| Source Catalog | Source catalog with physics explanations and platform notes |
| CLI Reference | Full command reference and examples |
| Conditioning | Raw vs VonNeumann vs SHA-256 conditioning modes |
| Trial Analysis Methodology | PEAR-style 200-bit trials, calibration gate, and references |
| Telemetry Model | Experimental telemetry_v1 context model and integration points |
| Rust API Reference | Core Rust API surface |
| Architecture | Crate structure and design decisions |
| Python SDK | PyO3 bindings and Python API reference |
| Examples | Rust and Python code examples |
| Troubleshooting | Common issues and fixes |
| Security | Threat model and responsible disclosure |
The expanded statistical analysis roadmap and method inventory were informed by:
We appreciate the open-source work that helped shape this comparative QRNG/PRNG analysis surface.
The current source registry spans 13 mechanism-based categories; actual availability varies by platform:
| Category | Count |
|---|---|
| Thermal | 4 |
| Timing | 7 |
| Scheduling | 6 |
| IO | 6 |
| IPC | 4 |
| Microarchitecture | 16 |
| GPU | 3 |
| Network | 3 |
| System | 6 |
| Signal | 3 |
| Sensor | 4 |
| Quantum | 1 |
For full per-source descriptions, platform availability, and physics notes, see Source Catalog.
Currently supported external hardware:
qcicada — Crypta Labs QCicada USB QRNG (manual)For the full command reference and examples, see CLI Reference.
Most-used workflows:
openentropy scan
openentropy bench
openentropy stream --format hex --bytes 64
openentropy analyze --profile security # NIST battery + entropy + sha256
openentropy analyze --profile deep # 100K + forensic + cross-corr + trials
openentropy record clock_jitter --duration 30s
openentropy sessions sessions/<id> --profile deep
openentropy compare sessions/<id-a> sessions/<id-b> --profile deep
On sessions, profile presets apply only when a specific session path is
provided. openentropy sessions with no path always stays in list mode.
PEAR-style trial methodology references (200-bit trials, terminal Z, weighted Stouffer composition, calibration gating) are documented in Trial Analysis Methodology.
[dependencies]
openentropy-core = "0.12"
use openentropy_core::{ConditioningMode, EntropyPool, detect_available_sources};
let sources = detect_available_sources();
println!("{} sources available", sources.len());
let pool = EntropyPool::auto();
let source = pool.source_names()[0].clone();
let bytes = pool
.get_source_bytes(&source, 256, ConditioningMode::Sha256)
.unwrap();
let health = pool.health_report();
Analyze and compare entropy data programmatically:
use openentropy_core::{full_analysis, compare, trial_analysis};
let data = pool.get_source_raw_bytes(&source, 5000).unwrap();
// Per-source statistical analysis
let analysis = full_analysis(&source, &data);
println!("Shannon entropy: {:.4} bits/byte", analysis.shannon_entropy);
// Differential comparison of two streams
let other = pool.get_source_raw_bytes(&source, 5000).unwrap();
let diff = compare("stream_a", &data, "stream_b", &other);
// PEAR-style trial analysis
let trials = trial_analysis(&data, &Default::default());
println!("Terminal Z: {:.4}, p = {:.4}", trials.terminal_z, trials.terminal_p_value);
Chaos theory analysis (distinguish true randomness from deterministic chaos):
use openentropy_core::chaos::chaos_analysis;
let result = chaos_analysis(&data);
println!("Hurst H={:.4}, Lyapunov λ={:.4}, D₂={:.4}",
result.hurst.hurst_exponent,
result.lyapunov.lyapunov_exponent,
result.correlation_dimension.dimension);
Cargo workspace with 6 crates:
| Crate | Description |
|---|---|
openentropy-core | Core library — sources, pool, conditioning |
openentropy-cli | CLI binary with TUI dashboard |
openentropy-server | Axum HTTP entropy server |
openentropy-tests | NIST SP 800-22 inspired test battery |
openentropy-python | Python bindings via PyO3/maturin |
openentropy-wasm | WebAssembly/browser entropy crate |
flowchart TD
Sources[Sources 63] --> Raw[raw samples]
Raw --> Pool[Entropy Pool XOR combine]
Pool --> Modes{Conditioning mode}
Modes -->|default| Sha[sha256]
Modes --> Vn[vonneumann]
Modes -->|passthrough| RawMode[raw]
Sha --> Output[Output surfaces]
Vn --> Output
RawMode --> Output
Output --> Rust[Rust API]
Output --> CLI[CLI and TUI]
Output --> Http[HTTP Server]
Output --> Pipe[Named Pipe]
Output --> Py[Python SDK]| Platform | Sources | Notes |
|---|---|---|
| MacBook (M-series) | 63/63 | Full suite — WiFi, BLE, camera, mic |
| Mac Mini / Studio / Pro | 50–55 | No built-in camera, mic on some models |
| Intel Mac | ~20 | Some silicon/microarch sources are ARM-specific |
| Linux | 12–15 | Timing, network, disk, process sources + NVMe passthrough |
The library detects available hardware at runtime and only activates working sources.
Requires Rust 1.85+ and macOS or Linux.
git clone https://github.com/amenti-labs/openentropy.git
cd openentropy
cargo build --release --workspace --exclude openentropy-python
cargo test --workspace --exclude openentropy-python
cargo install --path crates/openentropy-cli
pip install maturin
maturin develop --release
python3 -c "from openentropy import EntropyPool; print(EntropyPool.auto().get_random_bytes(16).hex())"
See CONTRIBUTING.md. Ideas:
MIT — Copyright © 2026 Amenti Labs