Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is pycryptodomex and how does it differ from pycryptodome?

Today I saw PySNMP installing pycryptodomex. The x in that name looked suspicious and surprising.

I tried to track it down, but it looks like both pycryptodome and pycryptodomex are owned by the same account and point back to the same Github repository.

Especially because a cryptography library is a core security feature, I'm suspicious of the duplication.

What's the purpose of this duplication? Could I have discovered this information from open sources?

like image 992
Jason R. Coombs Avatar asked Jan 08 '18 17:01

Jason R. Coombs


People also ask

What is Python pycryptodomex?

PyCryptodome is a self-contained Python package of low-level cryptographic primitives. It supports Python 2.7, Python 3.5 and newer, and PyPy. You can install it with: pip install pycryptodomex. All modules are installed under the Cryptodome package.

Is PyCrypto maintained?

PyCrypto - The Python Cryptography Toolkit x is unmaintained and obsolete. Known security vulnerabilities have been patched downstream by backporting code from PyCryptodome (see below).

Is PyCrypto deprecated?

PyCrypto 2. x is unmaintained, obsolete, and contains security vulnerabilities.


1 Answers

It's the same code, just different names.

  • pycryptodome has some association to pyCrypto and can be considered a drop in replacement when migrating from PyCrypto to PyCryptodome.

  • pycryptodomex is a standalone version of PyCryptodome with a different naming convention; instead of the package Crypto, you have to use Cryptodome. In the case that PyCrypto is required for legacy purposes, pycryptodome should be used.

Per the repository:

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

  1. 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.

  2. 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 PyCryptodomex can coexist.

like image 111
Emmanuel Ferran Avatar answered Oct 08 '22 17:10

Emmanuel Ferran