I have created an API that validates data based on PyNacl at the backend. I am accepting length 64 hexadecimal-encoded sender and recipient account numbers for my simple Crypto API and validating the signature based on PyNacl library. I was wondering what Javascript library to use on my frontend so that the data I send using my React-based, it is coherent to my backend API. I looked at tweetnacl, but am not sure if they have the same working pattern. Can you give me some information about whether or not I can use tweetnacl, or will I have to create a python script that uses PyNacl to generate Signing Keys / Verify Keys, and signs the message?
Thanks.
Update! We have been successful at passing files between TweetLua and PyNaCl! The person writing the Lua side of the code had an "off by one" error (silly, but aren't most of our errors?). Once we got the right pieces in their proper places, it was a snap.
I know the use of Lua instead of JavaScript isn't a perfect match to this question, but I hope that people who find this will get some use all the same. It boils down to: Yes, TweetNaCl and PyNaCl are compatible, just as you'd expect.
Important element in this process:
Lua encryption:
Python decryption:
Previous response: So far as I can tell, no, TweetNaCl and PyNaCl are not compatible. My group is attempting to encrypt a file with c# TweetNaCl and decrypt with python, and I always end up with a general
nacl.exceptions.CryptoError: An error occurred trying to decrypt the message
. If you / someone else figures out a solution, I'd love to hear it!