Closed johnjjung closed 4 years ago
Well it looks like if we do something like this, then it'll strip out unsafe characters
if __name__ == '__main__': #code to execute if called from command-line
test = '''©'''
test = test.encode('ascii','ignore').decode('utf-8')
print(aes256().decrypt(aes256().encrypt(test, "pass"), "pass"))
Issues with passing None
if __name__ == '__main__': #code to execute if called from command-line
test = None
print(aes256().decrypt(aes256().encrypt(test, "pass"), "pass"))
Throws error:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/base64.py", line 81, in b64decode
s = _bytes_from_decode_data(s)
File "/usr/local/lib/python3.5/base64.py", line 46, in _bytes_from_decode_data
"string, not %r" % s.__class__.__name__) from None
TypeError: argument should be a bytes-like object or ASCII string, not 'NoneType'
Same thing with emojis
if __name__ == '__main__': #code to execute if called from command-line
test = '''🌷'''
test = test.encode('ascii','ignore').decode('utf-8')
print(aes256().decrypt(aes256().encrypt(test, "pass"), "pass"))
Just doubled checked and emoji's can be encrypted decrypted using aes256cbc
This is python3.5
I'm sure I have
# -*- coding: utf-8 -*-
at the top of the file, but not sure what's going on.self.__pkcs5_padding(raw)
outputsThen throws an error at