We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Same error on linux python 2.7 and os x python 2.7
In [1]: from simplecrypto import encrypt, decrypt, AesKey In [2]: # `encrypt` and `decrypt` use AES-256. In [3]: m = encrypt('secret message', 'secret key') --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-3-31706546d5a4> in <module>() ----> 1 m = encrypt('secret message', 'secret key') /Library/Python/2.7/site-packages/simplecrypto/key.pyc in encrypt(message, key) 192 Shortcut for AES256 base64 encryption with string or bytes key. 193 """ --> 194 return AesKey(to_bytes(key)).encrypt(message) 195 196 def decrypt(encrypted_message, key): /Library/Python/2.7/site-packages/simplecrypto/key.pyc in encrypt(self, message) 60 the base64 encoded encrypted message. 61 """ ---> 62 return base64(self.encrypt_raw(to_bytes(message))) 63 64 def decrypt(self, encrypted_message): /Library/Python/2.7/site-packages/simplecrypto/formats.pyc in to_base64(message) 11 Returns the base64 representation of a string or bytes. 12 """ ---> 13 return b64encode(to_bytes(message)).decode('ascii') 14 15 def from_base64(message): /Library/Python/2.7/site-packages/simplecrypto/formats.pyc in to_bytes(message) 36 """ 37 if isinstance(message, str): ---> 38 return message.encode('utf-8') 39 else: 40 return bytes(message) UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 0: ordinal not in range(128)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Same error on linux python 2.7 and os x python 2.7
The text was updated successfully, but these errors were encountered: