diff --git a/setup.py b/setup.py index 8b30244..9ee46a3 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name='sw-python-utils', - version='0.0.17', + version='0.0.18', description='Soft Way company python utils.', author='Telminov Sergey', url='https://github.com/telminov/sw-python-utils', @@ -16,6 +16,6 @@ license='The MIT License', test_suite='nose.collector', install_requires=[ - 'pycrypto', 'requests', 'beautifulsoup4', 'phonenumbers' + 'pycryptodome', 'requests', 'beautifulsoup4', 'phonenumbers' ], ) diff --git a/swutils/encrypt.py b/swutils/encrypt.py index edcf685..94a5130 100644 --- a/swutils/encrypt.py +++ b/swutils/encrypt.py @@ -7,7 +7,7 @@ def encrypt(raw, key): cipher = AES.new(_hash_key(key=key), AES.MODE_ECB) padded = _pad(raw) - encrypted = cipher.encrypt(padded) + encrypted = cipher.encrypt(padded.encode()) encoded = base64.b64encode(encrypted) return encoded