Skip to main content

Python library and CLI for Domain-based Integrity Verification Enforcement (DIVE)

Project description

OpenDIVE: Python Client for Domain-based Integrity Verification Enforcement (DIVE)

License: MIT Python: 3.8+ Version: 0.1.1 Status: Alpha

OpenDIVE is a Python client library for the DIVE protocol (Domain-based Integrity Verification Enforcement), a cryptographic protocol that leverages DNSSEC to verify the integrity and authenticity of web resources. DIVE operates as an additional security layer above HTTP/HTTPS, ensuring that resources are signed and validated against DNS-published keys.


Features

  • DNSSEC-backed verification: Uses DNS TXT records (_dive, _divekey) to publish policies and public keys.
  • Cryptographic signatures: Supports Ed25519 and Ed448 for signing, and SHA-256/384/512 for hashing.
  • CLI tool: Includes commands for verification, key generation, signing, and DNS inspection.
  • Incremental deployment: Works alongside existing infrastructure without breaking non-DIVE clients.
  • Reporting: Sends verification failure reports to a configurable endpoint.

Installation

From PyPI (Alpha Release)

pip install opendive-client

From Source

git clone https://github.com/diveprotocol/opendive-client.git
cd opendive-client
pip install -e .

Dependencies

  • Python 3.8+
  • dnspython (DNSSEC resolution)
  • cryptography (Ed25519/Ed448 support)
  • httpx (HTTP client)
  • click (CLI)

Usage

CLI Commands

OpenDIVE provides a CLI for common operations:

# Verify a resource
opendive verify https://example.com/file.tar.gz

# Download a resource (only if DIVE verification passes)
opendive download https://example.com/file.tar.gz

# Generate a key pair
opendive keygen --alg ed25519 --key-id mykey --domain example.com

# Sign a file
opendive sign myfile.tar.gz --private-key <base64_private_key> --key-id mykey

# Inspect DNS records
opendive dns example.com --key-id mykey

Python Library

from dive.client import DiveClient

client = DiveClient(require_dnssec=True)
result = client.verify("https://example.com/file.tar.gz")

if result.accepted:
    print("Resource is authentic!")
else:
    print(f"DIVE rejected resource: {result.failure_reason}")

Documentation

DIVE Protocol

OpenDIVE API


Development

Running Tests

pytest tests/

Contributing

Pull requests are welcome! For major changes, please open an issue first.


License

MIT License. See LICENSE for details.


Security

For security issues, see SECURITY.md.


Contact

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

opendive_client-0.1.1.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

opendive_client-0.1.1-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file opendive_client-0.1.1.tar.gz.

File metadata

  • Download URL: opendive_client-0.1.1.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opendive_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 01002be14e74406dea2bc9a84c238cb8da35e75a67cdee7f93265fb9d76daa3f
MD5 ff88054f14f8f6891f00fc5d0419b2bd
BLAKE2b-256 2ccc6f0bd213f7188a88308ece9f6f2688ff839c23a9e076e893940ec793971e

See more details on using hashes here.

Provenance

The following attestation bundles were made for opendive_client-0.1.1.tar.gz:

Publisher: publish.yml on diveprotocol/opendive-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opendive_client-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for opendive_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d2d180046c17bf44a74d99be0b9eb932450a385d3b0804e6f2a0b61fdfc5479c
MD5 d7ea8d10a4c6d6e57c0dba7fc5edfbbb
BLAKE2b-256 590226df398c9924b55ed886c80c7f979ef13c425fd5b7ec1c5821a73bf27af8

See more details on using hashes here.

Provenance

The following attestation bundles were made for opendive_client-0.1.1-py3-none-any.whl:

Publisher: publish.yml on diveprotocol/opendive-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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