nvie / SimpleAES

AES-256 encryption and decryption in Python for mere mortals.
Other
55 stars 20 forks source link

Incompatibility with python 2.7.12 #7

Closed raccoon4me closed 7 years ago

raccoon4me commented 7 years ago

Hi, picture worth thousand word, so i'll try to be quick:

PYTHON 2.7.9

Python 2.7.9 (default, Mar 1 2015, 12:57:24) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from SimpleAES import SimpleAES aes = SimpleAES("isdefinitelynot4u2no") aes.decrypt("U2FsdGVkX1+eUdcEgzX6WUVO0xmuShSzlHWHlZVoVC8=") 'codewie\n'

PYTHON 2.7.12

+Python 2.7.12 (default, Jun 29 2016, 08:57:23) [GCC 5.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from SimpleAES import SimpleAES aes = SimpleAES("isdefinitelynot4u2no") aes.decrypt("U2FsdGVkX1+eUdcEgzX6WUVO0xmuShSzlHWHlZVoVC8=") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/site-packages/SimpleAES/init.py", line 71, in decrypt raise DecryptionError('Could not decrypt.') SimpleAES.exceptions.DecryptionError: Could not decrypt.

Adding the fact that we can't encrypt either

Python 2.7.12 (default, Jun 29 2016, 08:57:23) [GCC 5.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from SimpleAES import SimpleAES key = 'Some arbitrary bytestring.' aes = SimpleAES(key) aes.encrypt('My secret plaintext data') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/site-packages/SimpleAES/init.py", line 54, in encrypt raise EncryptionError('Could not encrypt.') SimpleAES.exceptions.EncryptionError: Could not encrypt.

Could you have a look at it, you rely on pycrypto, so could it be this library that is failing?

Thanks and Regards

nvie commented 7 years ago

This project is pretty old and won't be maintained further. For much better (!) symmetric encryption, I advise to take a look at the cryptography package: it's super friendly!

Here's an API that offers the same simple API: https://cryptography.io/en/latest/fernet/

raccoon4me commented 7 years ago

Thanks for your return, i will check it out :)