You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while trying to use this project, I've stumbled on the issue that it is not possible to use RNCryptor to en-/decrypt bytes().
Specifically here the result is always cast to str().
My workaround was to define a custom subclass that patches out this to_str() call like this:
classBytesCrypter(rncryptor.RNCryptor):
defpost_decrypt_data(self, data):
# super call normalizes return value to str() which breaks usdata=data[:-rncryptor.bord(data[-1])]
returndata
Since encrypt() already supports byte data, it would be very helpful if decrypt() could support that too. I'd imagine that could be achieved ether with a keyword (only) argument like this:
I would like the encryption interface to work solely on bytes if possible, especially on python 3 as that would be much more uniiversal, but I'm not sure if that api breakage would be ok - hence the post_process argument idea.
The text was updated successfully, but these errors were encountered:
Hi there,
while trying to use this project, I've stumbled on the issue that it is not possible to use RNCryptor to en-/decrypt bytes().
Specifically here the result is always cast to
str()
.My workaround was to define a custom subclass that patches out this
to_str()
call like this:Since
encrypt()
already supports byte data, it would be very helpful ifdecrypt()
could support that too. I'd imagine that could be achieved ether with a keyword (only) argument like this:I would like the encryption interface to work solely on bytes if possible, especially on python 3 as that would be much more uniiversal, but I'm not sure if that api breakage would be ok - hence the
post_process
argument idea.The text was updated successfully, but these errors were encountered: