Entropy Modes

TrueEntropy offers three distinct entropy modes to balance security, performance, and cost. Choose the right mode for your application's needs.

Overview

All TrueEntropy API endpoints support the entropy_mode parameter, which controls the source of randomness for your request. The available modes are:

quantum-seeded

Quantum-Seeded (Default)

Every random number starts with genuine quantum entropy, cryptographically expanded using ChaCha20 for unlimited scale. Perfect for most applications.

pure

Pure Quantum

Direct from IBM Quantum hardware with no expansion or mixing. For cryptographic keys and regulatory compliance. Uses monthly credits.

CSPRNG

CSPRNG Only

Cryptographically secure pseudo-random numbers using system entropy. Available to all tiers, including free users.

Mode Comparison

Feature Quantum-Seeded Pure Quantum CSPRNG
Quantum Origin Yes (seed) Yes (100%) No
Scalability Unlimited Limited by credits Unlimited
Speed ~1μs/number ~10μs/number ~1μs/number
Cost Included Uses credits Free
Available Tiers Developer+ Pro+ All
Best For Gaming, simulations Crypto keys, compliance Development, testing

Using Entropy Modes

API Parameter

Add the entropy_mode parameter to any endpoint:

# Default (auto mode - selects based on your tier)
GET /api/v1/integers/?count=10&min=1&max=100

# Explicitly request quantum-seeded
GET /api/v1/integers/?count=10&min=1&max=100&entropy_mode=hybrid

# Request pure quantum (Pro+ tiers only)
GET /api/v1/integers/?count=10&min=1&max=100&entropy_mode=pure

Response Headers

The API returns the entropy mode used in response headers:

X-Entropy-Mode: quantum-seeded
X-Quantum-Credits-Remaining: 8453
X-Request-ID: 550e8400-e29b-41d4-a716-446655440000

Response Body

The response includes entropy mode information:

{
    "data": {
        "values": [42, 17, 89, 3, 61],
        "count": 5,
        "min": 1,
        "max": 100,
        "metadata": {
            "entropy_mode": "quantum-seeded",
            "quantum_source": "ibm_fez"
        }
    },
    "quantum_credits": {
        "remaining": 9216,
        "used": 0,
        "total": 10240
    },
    "meta": {
        "request_id": "550e8400-e29b-41d4-a716-446655440000",
        "duration_ms": 12
    }
}

Quantum Credit System

Monthly Allocations

Tier Monthly Credits Equivalent Usage
Free 0 No pure quantum access
Developer 0 Quantum-seeded only
Pro 10,240 bytes (10KB) ~640 AES-256 keys
Business 102,400 bytes (100KB) ~6,400 AES-256 keys
Enterprise Custom Negotiated

Credit Consumption

Pure quantum mode consumes credits based on the entropy required:

Best Practices

For Most Applications

Use the default quantum-seeded mode. It provides quantum-origin randomness with unlimited scalability at no additional cost.

For Cryptographic Keys

Use pure quantum mode when generating cryptographic keys, initialization vectors, or when regulatory compliance requires true randomness.

Code Examples

Python

from trueentropy import Client

client = Client(api_key="YOUR_API_KEY")

# Default quantum-seeded mode
numbers = client.integers(count=10, min=1, max=100)

# Explicitly request pure quantum
key_bytes = client.bytes(
    count=32,
    format="hex",
    entropy_mode="pure"  # Uses credits
)

# Check remaining credits
print(f"Credits remaining: {key_bytes.quantum_credits.remaining}")

JavaScript

import { TrueEntropy } from 'trueentropy';

const client = new TrueEntropy('YOUR_API_KEY');

// Default quantum-seeded mode
const numbers = await client.integers({
    count: 10,
    min: 1,
    max: 100
});

// Request pure quantum for cryptographic key
const keyBytes = await client.bytes({
    count: 32,
    format: 'hex',
    entropyMode: 'pure'  // Uses credits
});

console.log(`Credits remaining: ${keyBytes.quantumCredits.remaining}`);

cURL

# Quantum-seeded (default)
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.trueentropy.net/v1/integers/?count=10&min=1&max=100"

# Pure quantum
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.trueentropy.net/v1/bytes/?count=32&format=hex&entropy_mode=pure"

Technical Details

Quantum Seeding Process

  1. 32 bytes of quantum entropy obtained from IBM Quantum hardware
  2. Seed expanded using ChaCha20 stream cipher
  3. Output mixed with system entropy for defense in depth
  4. Seeds refreshed periodically based on tier:
    • Developer: Every 6 hours
    • Pro: Every hour
    • Business: Every 15 minutes
    • Enterprise: Every 5 minutes

Security Properties