Skip to content
New issue

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

Malformed utf-8 error thrown when decrypting large tokens encrypted in Python #23

Open
mraleson opened this issue Oct 15, 2022 · 1 comment

Comments

@mraleson
Copy link

I encrypted some data using Fernet from Cryptography Python package. I was able to decrypt some short messages, but for larger messages I got a "Error: Malformed UTF-8 data" error raised from Object.stringify in crypto-js core.js.

As a workaround I had to abandon the fernet.js library and wrote a decrypt function myself. Its totally untested, but seems to decrypt. I tried to follow the pattern outlined in Python's implementation. For anyone else working around the same issue here is a gist with my node Fernet decrypt function

@sinamics
Copy link

Had the exact same issue when decrypting larger chunks..
your gist code worked perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants