Python scripts that verifies the correctness of the values delivered by both CLCERT and NIST Randomness Beacon services.
$ pip install -r requirements.txt
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.
$ 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
scripts/rt_external_events.py
In development, will be available soon.
Implementation of the sloth
algorithm, an slow hash function used in the project.
Script that checks the correct status of all the endpoints of the public API.
Script that collects the last 15625 random values (1 MB) delivered by the beacon.
Specification of the digital signature on each pulse.
If this error raises, please run the scripts prepending: PYTHONPATH=.