encrypt = function(input,num,type) { output = ""; num++; char_set = '$%^NOZ1&PQR(./~`CDEFG-!@STUVWZghij}:?[]\',ef34590qrklmnoIJ)_+{st67 abcdAyzKLM2Y'; alpha_length = char_set.length - num; for (loop=0; loop char_set.length){ space = char_set.length - char_code; char_code = num - space; }else{ char_code += num; } }else{ //decode if (char_code - num < 0){ space = num - char_code; char_code = char_set.length - space; }else{ char_code -= num; } } output += char_set.charAt(char_code); } return (output); } output = encrypt(dataXML,5,"encode");