Skip to main content

A Python implementation of the Extended Triple Diffie-Hellman key agreement protocol.

Project description

PyPI PyPI - Python Version Build Status Documentation Status

python-x3dh

A Python implementation of the Extended Triple Diffie-Hellman key agreement protocol.

Installation

python-x3dh depends on two system libraries, libxeddsa>=2,<3 and libsodium.

Install the latest release using pip (pip install X3DH) or manually from source by running pip install . (preferred) or python setup.py install in the cloned repository. The installation requires libsodium and the Python development headers to be installed. If a locally installed version of libxeddsa is available, python-xeddsa (a dependency of python-x3dh) tries to use that. Otherwise it uses prebuilt binaries of the library, which are available for Linux, MacOS and Windows on the amd64 architecture, and potentially for MacOS arm64 too. Set the LIBXEDDSA_FORCE_LOCAL environment variable to forbid the usage of prebuilt binaries.

Differences to the Specification

In the X3DH specification, the identity key is a Curve25519/Curve448 key and XEdDSA is used to create signatures with it. This library does not support Curve448, however, it supports Ed25519 in addition to Curve25519. You can choose whether the public part of the identity key in the bundle is transferred as Curve25519 or Ed25519. Refer to the documentation for details.

Testing, Type Checks and Linting

python-x3dh uses pytest as its testing framework, mypy for static type checks and both pylint and Flake8 for linting. All tests/checks can be run locally with the following commands:

$ pip install --upgrade pytest pytest-asyncio pytest-cov mypy pylint flake8
$ mypy --strict x3dh/ setup.py tests/
$ pylint x3dh/ setup.py tests/
$ flake8 x3dh/ setup.py tests/
$ pytest --cov=x3dh --cov-report term-missing:skip-covered

Documentation

View the documentation on readthedocs.io or build it locally, which requires the Python packages listed in docs/requirements.txt. With all dependencies installed, run make html in the docs/ directory. You can find the generated documentation in docs/_build/html/.

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

X3DH-1.0.1.tar.gz (21.8 kB view details)

Uploaded Source

File details

Details for the file X3DH-1.0.1.tar.gz.

File metadata

  • Download URL: X3DH-1.0.1.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.2

File hashes

Hashes for X3DH-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e40bd2b80511d17cbe521084e7f4a2c183cf4a685fbc254a3e963a59a687170b
MD5 e02208633c4d89b08cf31e1f3f39a5cd
BLAKE2b-256 1459be52962a0a721aa2024c83aad72bfbdcacd3a2ecef0524b8ccab156d3d37

See more details on using hashes here.

Supported by

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