-
• #2
You may use crypto-js (i didn't test it personally but should work) and there are tons of JavaScript implementation of the cryptographic algorithms out there on the net.
if your only concern is username/password, hash the password (with a seed) and send it to server. I think sha1 is the smallest/lightest hashing implementation.
Or if you want to spend less memory and have less security, check this XOR String Example, I just wrote for you.
I'm not sure if the Espruino can support encryption features.... If I had to guess, Espruino probably can't due to resources needed to encrypt data.
If that is the case, does anyone know of a way to encrypt data before sending the data out of the Espruino; eventually gets sent out of my WiFi module to a TCP server? I found https://www.sparkfun.com/products/11551 which is a way to securely store a key.
At the moment I am sending out unencrypted text such as login credentials that should be encrypted on the Espruino side then unencrypted at the server side.