Legrandin / pycryptodome

A self-contained cryptographic library for Python
https://www.pycryptodome.org
Other
2.86k stars 508 forks source link
cryptography python security

.. image:: https://github.com/Legrandin/pycryptodome/workflows/Integration%20test/badge.svg?branch=master :target: https://github.com/Legrandin/pycryptodome/actions

.. image:: https://badge.fury.io/py/pycryptodome.svg :target: https://pypi.org/project/pycryptodome

.. image:: https://badge.fury.io/py/pycryptodomex.svg :target: https://pypi.org/project/pycryptodomex

PyCryptodome

PyCryptodome is a self-contained Python package of low-level cryptographic primitives.

It supports Python 2.7, Python 3.6 and newer, and PyPy.

The installation procedure depends on the package you want the library to be in. PyCryptodome can be used as:

. an almost drop-in replacement for the old PyCrypto library.

You install it with::

   pip install pycryptodome

In this case, all modules are installed under the Crypto package.

One must avoid having both PyCrypto and PyCryptodome installed at the same time, as they will interfere with each other.

This option is therefore recommended only when you are sure that the whole application is deployed in a virtualenv.

. a library independent of the old PyCrypto.

You install it with::

   pip install pycryptodomex

In this case, all modules are installed under the Cryptodome package. PyCrypto and PyCryptodome can coexist.

For faster public key operations in Unix, you should install GMP_ in your system.

PyCryptodome is a fork of PyCrypto. It brings the following enhancements with respect to the last official version of PyCrypto (2.6.1):

PyCryptodome is not a wrapper to a separate C library like OpenSSL. To the largest possible extent, algorithms are implemented in pure Python. Only the pieces that are extremely critical to performance (e.g. block ciphers) are implemented as C extensions.

For more information, see the homepage_.

For security issues, please send an email to security@pycryptodome.org.

All the code can be downloaded from GitHub_.

.. homepage: https://www.pycryptodome.org .. GMP: https://gmplib.org .. _GitHub: https://github.com/Legrandin/pycryptodome