Skip to main content

Python implementation of the Axolotl ratchet protocol

Project description

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.

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

pyaxo_ng-1.0.1.tar.gz (63.6 kB view details)

Uploaded Source

Built Distribution

pyaxo_ng-1.0.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyaxo_ng-1.0.1.tar.gz
  • Upload date:
  • Size: 63.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pyaxo_ng-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d064b2a0175dbf094b92c9d238405b2e6cb47e3081e49e80c7ec1d790c09ae34
MD5 46a9c39ae8376054c4504ae1c9414ae8
BLAKE2b-256 2b0796c7822b8f1dbecb8e7d2e00c52dcdf87b200044ce7bd937add6d9e6be9e

See more details on using hashes here.

File details

Details for the file pyaxo_ng-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyaxo_ng-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pyaxo_ng-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c152666064f023d1f401546469fb7b875ef765ddd8675c5ff54adbe6f6f59fe6
MD5 7126074d9369cbe4a1ecfd7c9a65fc56
BLAKE2b-256 63d20f426c5a2351fd1bdcef0b220119e6931ca807c7696da3a57e517080990f

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