Skip to main content

🎲 The truth external PyPI random package, have true_rand, virt_rand, hash_rand, ...

Project description

MultiRandom 🎲

A comprehensive library for exploring and generating randomness across the spectrum—from true physical entropy to mathematical pseudo-randomness and everything in between.

🌟 Overview

MultiRandom is designed for developers, researchers, and hobbyists who want to understand high-quality randomness. It provides tools to fetch random data from quantum sources, physical human interaction, and modern mathematical algorithms.

[!WARNING] Security Note: This library contains both "True" and "Pseudo" random sources. While some sources (like QRNG) are highly secure, others (like LCGs) are provided for educational purposes and include reverse logic to demonstrate their insecurity. Always use the appropriate generator for your use case.


🏗 Project Structure

multirandom/
└── src/
    └── multirandom/
        ├── true_rand/          # Physical & Hardware Entropy
        │   ├── rand_via_clicks.py       # Human-in-the-loop entropy
        │   ├── rand_using_online_api.py # Quantum & Hardware APIs (ANU QRNG, Roll-API)
        │   └── weather_rand.py          # [Coming Soon] Weather-based entropy
        ├── virt_rand/          # Mathematical Randomness (PRNGs)
        │   ├── xor_shift.py             # XorShift & Xoshiro Family
        │   ├── rand_using_virt_lcg.py   # Linear Congruential Generators (LCGs)
        │   └── flash_rand_and_reverse.py # [Coming Soon] Specialized PRNGs
        └── hash_rand/          # Hash-based Generators
            ├── sha_rand.py              # SHA-1, SHA-256, SHA-512 based PRNGs
            └── original_random.py       # Wrapper for Python's built-in random

🛠 Features & Usage

1. Human-in-the-loop Entropy (true_rand)

Uses pyautogui and Windows API to capture sub-microsecond timing jitter and spatial coordinates from physical mouse clicks.

from multirandom.true_rand.rand_via_clicks import RealRandomUsingBetweenMixedClicks

# Requires a sequence of Left -> Right -> Middle clicks to seed
gen = RealRandomUsingBetweenMixedClicks()
print(gen.random())

2. Physical & Hardware APIs (true_rand)

Fetch "True" randomness from remote physical processes.

  • Australian National University (ANU): Quantum vacuum noise via QRNG.
  • Random.org: Atmospheric noise.
  • Roll-API: Physical dice rolling hardware.
  • Weather Entropy: (In development) Fetching randomness from real-time weather stations.

3. Bit-Shift Generators (virt_rand)

Implementations of the most popular mathematical generators used in modern systems.

  • Original XorShift: Includes reverse_roll() to demonstrate mathematical reversibility.
  • Scrambled Variants: Xorwow (CUDA), Xorshift+ (V8/Webkit).
  • Modern Xoshiro: Xoshiro256**, Xoroshiro128++ (Minecraft Java 1.18+).

4. Mathematical LCGs (virt_rand)

Classic Linear Congruential Generators with customizable shift parameters. Includes reverse_roll() methods to demonstrate the insecurity of simple modular arithmetic.


🚀 Installation & Setup

Requirements

  • Python 3.9+
  • Dependencies listed in requirements.txt (e.g., pyautogui, aiohttp)

Installation

pip install -r requirements.txt

Usage

from multirandom.virt_rand.xor_shift import Xorshift32

# Create a 32-bit XorShift generator
gen = Xorshift32(seed=12345)
print(gen.roll())

📺 Educational Resources

This project focuses on the limits of computer-generated randomness. For more context, check out:


📜 License

Provided for educational and research purposes under the GNU General Public License v3 (G GPLv3).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multirandom-0.0.2.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multirandom-0.0.2-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file multirandom-0.0.2.tar.gz.

File metadata

  • Download URL: multirandom-0.0.2.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.15.0a3

File hashes

Hashes for multirandom-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5afa4b834152f4a4159c4882e8bfa76a759f7cfc72a3073d2db304581ffb6b4d
MD5 d49a8c92849ffab615c580c50a7835e2
BLAKE2b-256 f1e5980ecc05e1bd19017188376b6770de63801d8982f4ca937f403366c5e3da

See more details on using hashes here.

File details

Details for the file multirandom-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: multirandom-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.15.0a3

File hashes

Hashes for multirandom-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04db53ad938ba5f1dd3535f9d1c3ae8a9706e4f64513112e4f2f9806c9e057f6
MD5 56b581bd9c5f56878e3b4700cb91c0bf
BLAKE2b-256 0a823e0d0229006204c72f071a45f86271a071bc70bb59da99aa3b607347f516

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page