Skip to main content

A Python tool for verifying inclusion and consistency proofs in the Rekor transparency log

Project description

Rekor Verifier

A Python tool for verifying inclusion and consistency proofs in the Rekor transparency log.

What it does

This tool lets you:

  • Verify that an artifact exists in the Rekor transparency log (inclusion proof)
  • Verify that the log hasn't been tampered with between two checkpoints (consistency proof)
  • Check cryptographic signatures on artifacts

It implements the RFC 6962 Certificate Transparency specification for Merkle tree verification.

Requirements

  • Python 3.11+
  • Dependencies listed in requirements.txt

Install dependencies:

pip install -r requirements.txt

Usage

Get the latest checkpoint

python assignment1/main.py --checkpoint

Verify inclusion of an artifact

You need the log index and the artifact file:

python assignment1/main.py --inclusion 126574567 --artifact ./path/to/artifact

This will:

  1. Fetch the log entry from Rekor
  2. Verify the artifact's signature
  3. Calculate and verify the Merkle tree root hash

Verify consistency between checkpoints

You need the tree ID, tree size, and root hash from a previous checkpoint:

python assignment1/main.py --consistency \
  --tree-id <tree-id> \
  --tree-size <size> \
  --root-hash <hash>

This compares your checkpoint against the current state of the log.

Debug mode

Add -d or --debug to any command for verbose output:

python assignment1/main.py -d --checkpoint

How it works

Inclusion proof: Given a log index and artifact, the tool fetches the entry from Rekor, extracts the public key from the certificate, verifies the signature, and uses the inclusion proof hashes to recalculate the Merkle tree root. If it matches the root in the proof, the artifact is verified.

Consistency proof: Given an old checkpoint (tree size + root hash) and the current state, the tool uses consistency proof hashes to verify that the old tree is a prefix of the new tree. This proves the log hasn't been retroactively modified.

Project structure

  • main.py - CLI interface and main verification logic
  • merkle_proof.py - RFC 6962 Merkle tree proof verification
  • util.py - Cryptographic utilities (signature verification, key extraction)
  • constants.py - API endpoints and configuration

Development

Run linters:

ruff check assignment1/
pylint assignment1/*.py

Run type checker:

mypy assignment1/

Run security scanner:

bandit -r assignment1/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rekor_verifier-4.0.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rekor_verifier-4.0.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file rekor_verifier-4.0.0.tar.gz.

File metadata

  • Download URL: rekor_verifier-4.0.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Darwin/24.2.0

File hashes

Hashes for rekor_verifier-4.0.0.tar.gz
Algorithm Hash digest
SHA256 2186432c2d902085dff93a240f6def5cdcc580b9991624026e80fe7ea3a361cd
MD5 845b6bf27c7ec5d2f108d889e57cdc2a
BLAKE2b-256 04488b7ca274047ecc81e66475fdd8ad95e9916ce16110756a2784c789a784f7

See more details on using hashes here.

File details

Details for the file rekor_verifier-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: rekor_verifier-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Darwin/24.2.0

File hashes

Hashes for rekor_verifier-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d1d3da14c10fb9293061e36b20e2c945d8ca1aa686fa508da0fd21591e7a0d9
MD5 bc6d8c6d608130f38b2614bdc949ce56
BLAKE2b-256 e03be9daee5ecf519eaf895ab9425704f1cfa37ce3585c6dfcc3f7967d3df622

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page