Skip to content

malonekt/research-randomizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Malone Randomizer

Lightweight GUI randomizer for verifiable, reproducible coin-flip-style draws.
Proof-friendly: writes human-readable logs and a hash-chain for auditability.


Files

  • Randomizer.py — main app (Tkinter GUI, internal XORShift PRNG).
  • randomizer_log.txt — append-only run log / proof-of-randomization.
  • run.bat — convenience runner for Windows.
  • .gitattributes — repository attributes.

Quick start

  1. Clone repo or drop files on your machine.
  2. Install dependencies (Python 3.8+ recommended):
python -m pip install --upgrade pip
python -m pip install pandas requests scikit-learn numpy scipy matplotlib
# (Only tkinter is required for this app; the above mirrors your capstone env.)
  1. Run the GUI:
python Randomizer.py
# or double-click run.bat on Windows

Usage (UI)

  • Click Randomize → app produces a result (1 or 2).
  • Click Clear Log → resets randomizer_log.txt for a fresh session.

How it works — short version

  1. A local XORShift-style PRNG seeds from the current timestamp for each session.

  2. Each next() value is used to derive a binary outcome (val % 2).

  3. Each output is written to randomizer_log.txt with:

    • raw PRNG output,
    • computation that produced the result,
    • the used bit,
    • and a SHA-256 hash chaining the output to the previous entry for tamper-evidence.

This lets a third party inspect the log and confirm the chain and parity computations.


Verifying randomness / audit

  • The app appends a session header with the session seed on start.
  • Every generated event is logged with raw value and a hash chain entry so logs are verifiable (see randomizer_log.txt).

Example log excerpt (real output):

534. 2025-07-22 00:17:50 - Result: 2
    Raw Output: 9753583289168338315
    Computation: (9753583289168338315 % 2) = 1 -> 2

(Full proof artifacts live in randomizer_log.txt.)


Notes / caveats

  • This is not cryptographically secure randomness for crypto tokens or gambling. It's deterministic XORShift seeded by timestamp — fine for demonstrations and proof-of-randomization, not for high-stakes use.
  • Logs are append-only by default; Clear Log intentionally resets for fresh sessions.
  • If you want cryptographically secure RNG, swap PRNG with secrets.SystemRandom() and adapt logging.

Example commands

# start GUI
python Randomizer.py

# view log
less randomizer_log.txt

License

MIT — you do what you want, retain attribution.


About

Lightweight GUI randomizer for verifiable, reproducible coin-flip-style draws. Proof-friendly: writes human-readable logs and a hash-chain for auditability.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors