Skip to content

Commit

Permalink
Merge pull request #397 from edx/thallada/switch-to-pycryptodomex
Browse files Browse the repository at this point in the history
Switch from PyCrypto to PyCryptodomex
  • Loading branch information
thallada authored Dec 21, 2017
2 parents a639810 + 1894dde commit b451cca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

from __future__ import absolute_import

__version__ = '1.3.2'
__version__ = '1.3.3'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
5 changes: 3 additions & 2 deletions edx_proctoring/backends/software_secure.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

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
Expand Down Expand Up @@ -337,7 +337,8 @@ def pad(text):
"""
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)
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b451cca

Please sign in to comment.