Skip to main content

Python implementation of the Double Ratchet Algorithm.

This is a fork of https://github.com/rxcomm/pyaxo aiming to update it to a more maintainable state.

Check out the py3 branch for the old pyaxo with python3 fixes.

Notable Changes

  • Change symmetric encryption to AES128-SIV (from XSalsa20/Poly)

  • Change KDF from pkdf2 to hkdf (sha512) * Added info recommendation for KDF_RK * Used RK as salt, DH as input instead of concat (§5.2.KDF_RK)

  • Change Chain/Message KDF to HMAC512 as recommended

  • Updated 3dh to X3DH specs

    • Added a simpler interface to create ratchet from X3DH

  • Change datastore from sqlite3 to diskcache

  • Make everything Python3 compatible

  • A large amount of code trimming/refactoring/documentation

Overview

The Double Ratchet Algorithm is a protocol (similar to OTR) that provides for perfect forward secrecy in (a)synchronous communications. It uses triple Diffie-Hellman for authentication and ECDHE for perfect forward secrecy. The protocol is lighter and more robust than the OTR protocol - providing better forward and future secrecy, as well as deniability.

The protocol was developed by Trevor Perrin and Moxie Marlinspike. Its chief use currently is in the Open Whisper Systems Signal package.

A nice writeup of the protocol is on the Open Whisper Systems Blog. You can find the most recent specification of the protocol here.

Installation instructions

Make sure that you have the following:

# If using Debian/Ubuntu
sudo apt-get install gcc libffi-dev libsodium-dev python-dev

# If using Fedora
sudo yum install gcc libffi-devel libsodium-devel python-devel redhat-rpm-config

If you use setuptools, change to pyaxo’s source folder and install with:

sudo python setup.py install

pyaxo will be ready for use!

Usage

There are several examples showing usage. There are also encrypt_pipe() and decrypt_pipe() methods for use in certain applications. I haven’t put together an example using them yet, but it should be straightforward.

Bugs, etc. should be reported to the pyaxo github issues page.

Metadata

Release files for pyaxo-ng 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyaxo-ng 1.0.1
File Size Uploaded Provenance Actions
pyaxo_ng-1.0.1.tar.gz 63.6 kB Without provenance Details for pyaxo_ng-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyaxo-ng 1.0.1
File Interpreter ABI Platform Actions
pyaxo_ng-1.0.1-py3-none-any.whl Python 3 none any Details for pyaxo_ng-1.0.1-py3-none-any.whl

Total release size: 83.7 kB

Release files / pyaxo_ng-1.0.1.tar.gz

Download URL pyaxo_ng-1.0.1.tar.gz
Size 63.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d064b2a0175dbf094b92c9d238405b2e6cb47e3081e49e80c7ec1d790c09ae34
BLAKE2b-256 checksum
How to use checksums
2b0796c7822b8f1dbecb8e7d2e00c52dcdf87b200044ce7bd937add6d9e6be9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

Release files / pyaxo_ng-1.0.1-py3-none-any.whl

Download URL pyaxo_ng-1.0.1-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c152666064f023d1f401546469fb7b875ef765ddd8675c5ff54adbe6f6f59fe6
BLAKE2b-256 checksum
How to use checksums
63d20f426c5a2351fd1bdcef0b220119e6931ca807c7696da3a57e517080990f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

Security for pyaxo-ng 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page