georgemarshall / django-cryptography

Easily encrypt data in Django
https://django-cryptography.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
371 stars 70 forks source link

BLAKE2b Throws Error #18

Open unformatt opened 5 years ago

unformatt commented 5 years ago

Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 29 2018, 20:59:26) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin django==1.11.15 django-cryptography==0.3 cryptography==2.3.1

settings.py

import cryptography.hazmat.primitives.hashes
CRYPTOGRAPHY_DIGEST = cryptography.hazmat.primitives.hashes.BLAKE2b
Traceback (most recent call last):
  File "./manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models()
  File "lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "xxxx/models.py", line 11, in <module>
    from django_cryptography.fields import encrypt
  File "lib/python2.7/site-packages/django_cryptography/fields.py", line 10, in <module>
    from django_cryptography.core.signing import SignatureExpired
  File "lib/python2.7/site-packages/django_cryptography/core/signing.py", line 20, in <module>
    from ..utils.crypto import constant_time_compare, salted_hmac
  File "lib/python2.7/site-packages/django_cryptography/utils/crypto.py", line 12, in <module>
    from ..conf import CryptographyConf
  File "lib/python2.7/site-packages/django_cryptography/conf.py", line 9, in <module>
    class CryptographyConf(AppConf):
  File "lib/python2.7/site-packages/appconf/base.py", line 74, in __new__
    new_class._configure()
  File "lib/python2.7/site-packages/appconf/base.py", line 105, in _configure
    cls._meta.configured_data = obj.configure()
  File "lib/python2.7/site-packages/django_cryptography/conf.py", line 32, in configure
    backend=backend,
  File "lib/python2.7/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py", line 25, in __init__
    if not backend.pbkdf2_hmac_supported(algorithm):
  File "lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 276, in pbkdf2_hmac_supported
    return self.hmac_supported(algorithm)
  File "lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 192, in hmac_supported
    return self.hash_supported(algorithm)
  File "lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 187, in hash_supported
    name = self._build_openssl_digest_name(algorithm)
  File "lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 179, in _build_openssl_digest_name
    algorithm.name, algorithm.digest_size * 8
TypeError: Error when calling the metaclass bases
    unsupported operand type(s) for *: 'property' and 'int'