Go to file
Kieran Prasch 9fa4ab7ba7 Updates Features List; Splits README sample code into three-part flow. 2018-02-17 16:57:47 -08:00
docs Updates Features List; Splits README sample code into three-part flow. 2018-02-17 16:57:47 -08:00
tests Ensures simple api is testable on multiple curves, with a test session default set. 2018-02-13 13:44:21 -08:00
umbral Changing all implemented instances of get_pub_key() to get_pubkey() 2018-02-13 12:50:44 -08:00
.gitignore changes multi-curve xfail reason. 2018-02-12 10:22:02 -08:00
.travis.yml Remove 3.7 from travis 2018-02-16 13:39:48 -07:00
Pipfile Initial sphinx project tree and build commands; Includes example jupyter notebooks. 2018-02-16 16:52:16 -08:00
Pipfile.lock Updates pipfile with sphinx deps. 2018-02-16 16:52:16 -08:00
README.rst Updates Features List; Splits README sample code into three-part flow. 2018-02-17 16:57:47 -08:00
demo.py Add pyUmbral demo code 2018-02-16 13:36:07 -07:00
setup.py Implement method save_key for UmbralPrivateKey with key encryption using Scrypt-Salsa20-Poly1305 2018-01-19 06:08:39 -07:00
tox.ini Basic setup 2017-12-28 02:06:20 +01:00

README.rst

.. role:: bash(code)
   :language: bash

=========
pyUmbral
=========

.. image:: https://travis-ci.org/nucypher/pyUmbral.svg?branch=master
    :target: https://travis-ci.org/nucypher/pyUmbral

pyUmbral is a python implementation of Umbral using OpenSSL and Cryptography.io,
enabling users to perform *split-key proxy-rencryption* and public key encryption
in an understandable and usable manner.

**Public Key Encryption**

.. code-block:: python

    from umbral import umbral, keys

    # Generate umbral keys for Alice.
    alices_private_key = keys.UmbralPrivateKey.gen_key()
    alices_public_key = private_key.get_pubkey()

    # Encrypt data with Alice's public key.
    plaintext = b'Proxy Re-encryption is cool!'
    ciphertext, capsule = umbral.encrypt(alices_public_key, plaintext)

    # Decrypt data with Alice's private key.
    cleartext = umbral.decrypt(capsule, alices_private_key,
                               ciphertext, alices_public_key)

**Generate Split Re-Encryption Keys**

.. code-block:: python

    # Generate umbral keys for Bob.
    bobs_private_key = keys.UmbralPrivateKey.gen_key()
    bobs_public_key = private_key.get_pubkey()

    # Generate split re-encryption keys with "M of N".
    kfrags, _ = umbral.split_rekey(alices_private_key, bobs_public_key, 10, 20)


**Proxy Re-encryption**

.. code-block:: python

  # Ursula exchanges key fragments with Bob.
  # Bob attaches the cfrags to the capsule.
  for kfrag in kfrags:
      cfrag = umbral.reencrypt(kfrag, capsule)
      capsule.attach_cfrag(cfrag)

  # Bob activates and opens the capsule.
  cleartext = umbral.decrypt(capsule, bobs_private_key,
                             ciphertext, alices_public_key)


Features
==========
- Proxy Re-encryption
- Threshold Re-encryption Key Splitting
- Bulk Data and Key Encapsulation
- Re-encryption Key Generation
- Public Key Encryption & Decryption
- Asymmetric Umbral Key Generation
- Elliptic Curve Arithmetic


Quick Installation
==================

The NuCypher team uses pipenv for managing pyUmbral's dependencies.
The recommended installation procedure is as follows:

.. code-block:: bash

    $ sudo pip3 install pipenv
    $ pipenv install

Post-installation, you can activate the project virtual enviorment
in your current terminal session by running :bash:`pipenv shell`.

For more information on pipenv, find the official documentation here: https://docs.pipenv.org/.


Technical documentation
========================
  "Umbral: A Threshold Proxy Re-Encryption Scheme"
  by David Nuñez

Technical documentation and cryptographic specifications
are availible on GitHub https://github.com/nucypher/umbral-doc/blob/master/umbral-doc.pdf


Support & Contribute
=====================

- Issue Tracker: https://github.com/nucypher/pyUmbral/issues
- Source Code: https://github.com/nucypher/pyUmbral