Skip to content
Snippets Groups Projects
Commit 76bead17 authored by Awais Qureshi's avatar Awais Qureshi
Browse files

BOM-437

Fixing python3
parent d16bf757
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,10 @@ class UsernameCipher(object):
@staticmethod
def encrypt(username):
initialization_vector = os.urandom(AES_BLOCK_SIZE_BYTES)
if not isinstance(initialization_vector, (bytes, bytearray)):
initialization_vector = initialization_vector.encode('utf-8')
aes_cipher = UsernameCipher._get_aes_cipher(initialization_vector)
encryptor = aes_cipher.encryptor()
padder = PKCS7(AES.block_size).padder()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment