Skip to main content
Help improve PyPI by participating in a 5-minute user interface survey!

Python binding to the Networking and Cryptography (NaCl) library

Project Description

Latest Version https://travis-ci.org/pyca/pynacl.svg?branch=master https://codecov.io/github/pyca/pynacl/coverage.svg?branch=master

PyNaCl is a Python binding to libsodium, which is a fork of the Networking and Cryptography library. These libraries have a stated goal of improving usability, security and speed. It supports Python 2.7 and 3.4+ as well as PyPy 2.6+.

Features

  • Digital signatures
  • Secret-key encryption
  • Public-key encryption
  • Hashing and message authentication
  • Password based key derivation and password hashing

Installation

Binary wheel install

PyNaCl ships as a binary wheel on OS X, Windows and Linux manylinux1 [1] , so all dependencies are included. Make sure you have an up-to-date pip and run:

$ pip install pynacl

Linux source build

PyNaCl relies on libsodium, a portable C library. A copy is bundled with PyNaCl so to install you can run:

$ pip install pynacl

If you’d prefer to use the version of libsodium provided by your distribution, you can disable the bundled copy during install by running:

$ SODIUM_INSTALL=system pip install pynacl

Warning

Usage of the legacy easy_install command provided by setuptools is generally discouraged, and is completely unsupported in PyNaCl’s case.

[1]manylinux1 wheels are built on a baseline linux environment based on Centos 5.11 and should work on most x86 and x86_64 glibc based linux environments.

Changelog

1.2.1 - 2017-12-04

  • Update hypothesis minumum allowed version.
  • Infrastructure: add proper configuration for readthedocs builder runtime environment.

1.2.0 - 2017-11-01

  • Update libsodium to 1.0.15.
  • Infrastructure: add jenkins support for automatic build of manylinux1 binary wheels
  • Added support for SealedBox construction.
  • Added support for argon2i and argon2id password hashing constructs and restructured high-level password hashing implementation to expose the same interface for all hashers.
  • Added support for 128 bit siphashx24 variant of siphash24.
  • Added support for from_seed APIs for X25519 keypair generation.
  • Dropped support for Python 3.3.

1.1.2 - 2017-03-31

  • reorder link time library search path when using bundled libsodium

1.1.1 - 2017-03-15

  • Fixed a circular import bug in nacl.utils.

1.1.0 - 2017-03-14

  • Dropped support for Python 2.6.
  • Added shared_key() method on Box.
  • You can now pass None to nonce when encrypting with Box or SecretBox and it will automatically generate a random nonce.
  • Added support for siphash24.
  • Added support for blake2b.
  • Added support for scrypt.
  • Update libsodium to 1.0.11.
  • Default to the bundled libsodium when compiling.
  • All raised exceptions are defined mixing-in nacl.exceptions.CryptoError

1.0.1 - 2016-01-24

  • Fix an issue with absolute paths that prevented the creation of wheels.

1.0 - 2016-01-23

  • PyNaCl has been ported to use the new APIs available in cffi 1.0+. Due to this change we no longer support PyPy releases older than 2.6.
  • Python 3.2 support has been dropped.
  • Functions to convert between Ed25519 and Curve25519 keys have been added.

0.3.0 - 2015-03-04

  • The low-level API (nacl.c.*) has been changed to match the upstream NaCl C/C++ conventions (as well as those of other NaCl bindings). The order of arguments and return values has changed significantly. To avoid silent failures, nacl.c has been removed, and replaced with nacl.bindings (with the new argument ordering). If you have code which calls these functions (e.g. nacl.c.crypto_box_keypair()), you must review the new docstrings and update your code/imports to match the new conventions.

Release history Release notifications

This version
History Node

1.2.1

History Node

1.2.0

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.1

History Node

1.0

History Node

0.3.0

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
PyNaCl-1.2.1-cp27-cp27m-macosx_10_6_intel.whl (243.6 kB) Copy SHA256 hash SHA256 Wheel cp27 Dec 4, 2017
PyNaCl-1.2.1-cp27-cp27m-manylinux1_i686.whl (659.1 kB) Copy SHA256 hash SHA256 Wheel cp27 Dec 4, 2017
PyNaCl-1.2.1-cp27-cp27m-manylinux1_x86_64.whl (696.9 kB) Copy SHA256 hash SHA256 Wheel cp27 Dec 4, 2017
PyNaCl-1.2.1-cp27-cp27mu-manylinux1_i686.whl (659.0 kB) Copy SHA256 hash SHA256 Wheel cp27 Dec 4, 2017
PyNaCl-1.2.1-cp27-cp27mu-manylinux1_x86_64.whl (696.9 kB) Copy SHA256 hash SHA256 Wheel cp27 Dec 4, 2017
PyNaCl-1.2.1-cp27-cp27m-win32.whl (162.3 kB) Copy SHA256 hash SHA256 Wheel cp27 Dec 4, 2017
PyNaCl-1.2.1-cp27-cp27m-win_amd64.whl (152.6 kB) Copy SHA256 hash SHA256 Wheel cp27 Dec 4, 2017
PyNaCl-1.2.1-cp34-cp34m-macosx_10_6_intel.whl (243.7 kB) Copy SHA256 hash SHA256 Wheel cp34 Dec 4, 2017
PyNaCl-1.2.1-cp34-cp34m-manylinux1_i686.whl (656.1 kB) Copy SHA256 hash SHA256 Wheel cp34 Dec 4, 2017
PyNaCl-1.2.1-cp34-cp34m-manylinux1_x86_64.whl (692.9 kB) Copy SHA256 hash SHA256 Wheel cp34 Dec 4, 2017
PyNaCl-1.2.1-cp34-cp34m-win32.whl (162.3 kB) Copy SHA256 hash SHA256 Wheel cp34 Dec 4, 2017
PyNaCl-1.2.1-cp34-cp34m-win_amd64.whl (152.6 kB) Copy SHA256 hash SHA256 Wheel cp34 Dec 4, 2017
PyNaCl-1.2.1-cp35-cp35m-macosx_10_6_intel.whl (243.7 kB) Copy SHA256 hash SHA256 Wheel cp35 Dec 4, 2017
PyNaCl-1.2.1-cp35-cp35m-manylinux1_i686.whl (656.1 kB) Copy SHA256 hash SHA256 Wheel cp35 Dec 4, 2017
PyNaCl-1.2.1-cp35-cp35m-manylinux1_x86_64.whl (692.9 kB) Copy SHA256 hash SHA256 Wheel cp35 Dec 4, 2017
PyNaCl-1.2.1-cp35-cp35m-win32.whl (159.5 kB) Copy SHA256 hash SHA256 Wheel cp35 Dec 4, 2017
PyNaCl-1.2.1-cp35-cp35m-win_amd64.whl (165.0 kB) Copy SHA256 hash SHA256 Wheel cp35 Dec 4, 2017
PyNaCl-1.2.1-cp36-cp36m-macosx_10_6_intel.whl (243.7 kB) Copy SHA256 hash SHA256 Wheel cp36 Dec 4, 2017
PyNaCl-1.2.1-cp36-cp36m-manylinux1_i686.whl (656.1 kB) Copy SHA256 hash SHA256 Wheel cp36 Dec 4, 2017
PyNaCl-1.2.1-cp36-cp36m-manylinux1_x86_64.whl (692.9 kB) Copy SHA256 hash SHA256 Wheel cp36 Dec 4, 2017
PyNaCl-1.2.1-cp36-cp36m-win32.whl (159.5 kB) Copy SHA256 hash SHA256 Wheel cp36 Dec 4, 2017
PyNaCl-1.2.1-cp36-cp36m-win_amd64.whl (165.0 kB) Copy SHA256 hash SHA256 Wheel cp36 Dec 4, 2017
PyNaCl-1.2.1.tar.gz (3.3 MB) Copy SHA256 hash SHA256 Source None Dec 4, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page