Skip to content

oglimmer/nist-random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

NIST Randomness Beacon

Verifiable, bias-resistant dice rolls anchored to the NIST Randomness Beacon 2.0.

A single-page Vue 3 app (no build step) that turns a public NIST beacon pulse plus a user-chosen seed into a SHA-256 hash and maps that hash to fair dice rolls. Anyone can re-fetch the same pulse and recompute the hash to verify the result — no trust in this tool required.

Live

Deployed to GitHub Pages on every push to main via .github/workflows/deploy.yml.

How it works

  1. Pulse — every 60 seconds NIST publishes a signed 512-bit beacon value generated by a hardware quantum RNG.
  2. HashSHA-256(beaconOutputValue + seed) produces a 256-bit (32-byte) digest.
  3. Dice — bytes are mapped to dice using rejection sampling (e.g. for d6: accept bytes < 252, take byte % 6 + 1) so each face is exactly equiprobable.

Seed format

NdS              e.g. 6d6, 2d20
LABEL#NdS        e.g. championship-2025#6d6

Constraints: 1 ≤ N ≤ 20, 2 ≤ S ≤ 100. Adding a label makes named draws at the same timestamp produce different hashes.

Modes

  • Create — pick a past timestamp + seed, get a hash and dice roll.
  • Verify — re-enter the same timestamp + seed plus an expected hash; the app confirms whether they match.

Why it can't be cheated

  • Before the draw, the future beacon value doesn't exist — the hash can't be precomputed.
  • After the draw, the pulse is permanently archived by NIST and signed with their hardware key.
  • Anyone can independently verify by re-fetching the pulse and rerunning the hash.

Stack

  • Vue 3 (CDN, no bundler)
  • Web Crypto API (crypto.subtle.digest)
  • corsproxy.io fallback when the NIST API blocks browser-origin CORS
  • English / German UI

Local development

Open index.html directly in a browser, or serve the directory:

python3 -m http.server 8000

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages