diff --git a/.travis.yml b/.travis.yml index f55afe3..63e397d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,6 @@ language: python python: - '2.7' - '3.5' + - '3.6' install: 'pip install -r requirements.txt -r test-requirements.txt' script: ./run_tests.sh diff --git a/README.md b/README.md index c6df1e1..5d340da 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ Install the potr Python module: sudo python setup.py install -__Dependencies__: pycrypto >= 2.1 (see [dlitz/pycrypto](https://github.com/dlitz/pycrypto)) +__Dependencies__: pycryptodome This software is experimental and potentially insecure. Do not rely on it ========================================================================= Usage Notes =========== -This module uses pycrypto's RNG. If you use this package in your application and your application +This module uses pycryptodome's RNG. If you use this package in your application and your application uses `os.fork()`, make sure to call `Crypto.Random.atfork()` in both the parent and the child process. Reporting bugs diff --git a/requirements.txt b/requirements.txt index 03917ad..acdfd20 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -PyCrypto >= 2.1 +pycryptodome diff --git a/setup.py b/setup.py index dd9bcb0..178660e 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ try: from setuptools.command.install_lib import install_lib - args['install_requires']=['pycrypto>=2.1'] + args['install_requires']=['pycryptodome'] except ImportError: print('\n*** setuptools not found! Falling back to distutils\n\n') from distutils.core import setup @@ -45,11 +45,11 @@ Install the potr Python module: sudo python setup.py install -**Dependencies**: pycrypto >= 2.1 (see `dlitz/pycrypto `_) +**Dependencies**: pycryptodome Usage Notes =========== -This module uses pycrypto's RNG. If you use this package in your application and your application +This module uses pycryptodomes's RNG. If you use this package in your application and your application uses ``os.fork()``, make sure to call ``Crypto.Random.atfork()`` in both the parent and the child process. Reporting bugs diff --git a/src/potr/compatcrypto/pycrypto.py b/src/potr/compatcrypto/pycrypto.py index e2cba50..38612f8 100644 --- a/src/potr/compatcrypto/pycrypto.py +++ b/src/potr/compatcrypto/pycrypto.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from Crypto import Cipher +from Crypto.Cipher import AES from Crypto.Hash import SHA256 as _SHA256 from Crypto.Hash import SHA as _SHA1 from Crypto.Hash import HMAC as _HMAC @@ -43,7 +43,7 @@ def AESCTR(key, counter=0): counter = Counter(counter) if not isinstance(counter, Counter): raise TypeError - return Cipher.AES.new(key, Cipher.AES.MODE_CTR, counter=counter) + return AES.new(key, AES.MODE_CTR, counter=counter) class Counter(object): def __init__(self, prefix):