Skip to content

clcert/beacon-verifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLCERT/NIST Randomness Beacon Verifier Scripts

Python scripts that verifies the correctness of the values delivered by both CLCERT and NIST Randomness Beacon services.

Install requirements

$ pip install -r requirements.txt

Scripts

1. Chain Consistency

scripts/chain_consistency_version2.py

Each new pulse that is created by the service must be linked to previous pulses that were created before. In order to achieve that, each pulse must reference to pulses and values committed in the past. Specifically, there are some properties that each pulse in the chain must fulfill in order to preserve the consistency and correctness of the chain:

  • Correct reference to previous pulses.
  • Use of local random value committed in the valid pulse created immediately before.
  • Correct use of slow hash function (sloth proposed by Arjen Lenstra and Benjamin Wesolowski described in this paper and implementation based in this github repository) to create output value.
  • Valid signature.

The script checks all this properties for each pulse and reports if there are any pulses that doesn't fulfill some of this properties.

How to Use

$ python scripts/chain_consistency_version2.py [options] [values]

Organization:
--organization {NIST, CLCERT} Select which randomness beacon service to analyze.

Propierties to analyze:
 -a          Run all tests (check all properties).
 -c          Checks only local random value pre-committed.
 -s          Checks only valid signature.
 -o          Checks only correct generation of output value using hash function.
 -p          Checks only reference of previous pulses already created in the chain.

Pulses to verify:
 --init   [value]  Set initial pulse as the one with id [value] to analyze.
 --final  [value]  Set final pulse as the one with id [value] to analyze.
 --random [value]  Checks only [value] pulses selected at random.
 --only   [value]  Checks only the pulse with id [value].

 Optional:
 -v          Verbose mode

Example: In order to analyze all properties in all the pulses generated by NIST Randomness service in verbose mode:

$ python scripts/chain_consistency_version2.py --organization NIST -av

2. Real-Time External Events Verifier

scripts/rt_external_events.py

In development, will be available soon.

Utils

crypto/sloth.py

Implementation of the sloth algorithm, an slow hash function used in the project.

api_test.py

Script that checks the correct status of all the endpoints of the public API.

get_last_megabyte.py

Script that collects the last 15625 random values (1 MB) delivered by the beacon.

Docs

signature.md

Specification of the digital signature on each pulse.

Errors

ModuleNotFoundError

If this error raises, please run the scripts prepending: PYTHONPATH=.

About

Python scripts that verify the correctness of the values delivered by both CLCERT/NIST Randomness Beacon services

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages