Added javascript encryption functions