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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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