I am currently sending data back and forth between flutter and nodeJS. I wanted to secure the data that is being sent so I found this post here on stack overflow of exactly what I need to do. This is great and all. However, there are 2 issues that arise.
The answer does not really answer the question fully and leaves me wondering how the code provided will be used.
JSEncrypt when installed using both
npm i jsencryptandnpm i @types/jsencryptI always get the sameReferenceErrorstating thatwindow is undefinedinjsencrypt.cson line 18. I tried looking for answers to this issue but I haven't found anything that has worked, including:
setting global.window to jsdom window setting globalThis.window to a jsdom window
So my question is:
- Can I encrypt and decrypt using RSA just like the post but in a clearer and error-free way?
or
- Is there a way I can encrypt and decrypt using AES 256-bit? (I would prefer this a lot more) between flutter and node js?