Commit 83ba9ab9 by Tyler Hallada

Pass only byte strings to pycryptodome

Only pass unicode encoded string to pycryptodome
parent aaf80d17
...@@ -337,7 +337,8 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider): ...@@ -337,7 +337,8 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
""" """
Apply padding 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) cipher = DES3.new(key, DES3.MODE_ECB)
encrypted_text = cipher.encrypt(pad(pwd)) encrypted_text = cipher.encrypt(pad(pwd))
return base64.b64encode(encrypted_text) return base64.b64encode(encrypted_text)
......
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