Unverified Commit b451cca0 by Tyler Hallada Committed by GitHub

Merge pull request #397 from edx/thallada/switch-to-pycryptodomex

Switch from PyCrypto to PyCryptodomex
parents a639810d 1894ddef
......@@ -4,6 +4,6 @@ The exam proctoring subsystem for the Open edX platform.
from __future__ import absolute_import
__version__ = '1.3.2'
__version__ = '1.3.3'
default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
......@@ -17,7 +17,7 @@ import requests
from django.conf import settings
from Crypto.Cipher import DES3
from Cryptodome.Cipher import DES3
from edx_proctoring.backends.backend import ProctoringBackendProvider
from edx_proctoring import constants
......@@ -337,7 +337,8 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
"""
Apply padding
"""
return text + (block_size - len(text) % block_size) * chr(block_size - len(text) % block_size)
return (text + (block_size - len(text) % block_size) *
chr(block_size - len(text) % block_size)).encode('utf-8')
cipher = DES3.new(key, DES3.MODE_ECB)
encrypted_text = cipher.encrypt(pad(pwd))
return base64.b64encode(encrypted_text)
......
......@@ -6,7 +6,7 @@ django-model-utils>=2.3.1
djangorestframework>=3.1,<3.7
django-ipware>=1.1.0
pytz>=2012h
pycrypto>=2.6
pycryptodomex>=3.4.7
python-dateutil>=2.1
# edX packages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment