-
Here is a script I wrote to watch analog input at http://github.com/anars/Espruino/tree/master/analog_read_watch
Usage
// constructor parameters (watchPin, eventFunction, timeout, difference, repeat)
var obj = new AnalogReadWatch(C4, function(data) { print(data); }, 1000, 0.01, true );
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.