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
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-jscore.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