Lightweight GUI randomizer for verifiable, reproducible coin-flip-style draws.
Proof-friendly: writes human-readable logs and a hash-chain for auditability.
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.
- Clone repo or drop files on your machine.
- 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.)- Run the GUI:
python Randomizer.py
# or double-click run.bat on Windows- Click Randomize → app produces a result (1 or 2).
- Click Clear Log → resets
randomizer_log.txtfor a fresh session.
-
A local XORShift-style PRNG seeds from the current timestamp for each session.
-
Each
next()value is used to derive a binary outcome (val % 2). -
Each output is written to
randomizer_log.txtwith:- 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.
- 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.)
- 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 Logintentionally resets for fresh sessions. - If you want cryptographically secure RNG, swap PRNG with
secrets.SystemRandom()and adapt logging.
# start GUI
python Randomizer.py
# view log
less randomizer_log.txtMIT — you do what you want, retain attribution.