ar1 = new Array('0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' ); ar2 = new Array('48','49','50','51','52','53','54','55','56','57','65', '66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86', '87','88','89','90','97','98','99','100','101','102', '103','104','105','106','107','108','109','110','111','112','113','114','115', '116','117','118','119','120','121','122'); function maskData(data,key) { //data is the encrypted 32 digit string //key will be the Random generated number from the JSP var maskedData=''; var curChar = ''; var curAscii = ''; for(i = 0 ; i < 32 ; i++) { curChar = data.substring(i,(i+1)); for(j=0;j < ar1.length ; j++) { if(curChar==ar1[j]) { curAscii=ar2[j]; break; } } maskedData = maskedData + '' + (parseInt(curAscii * 3)+parseInt(key)); //alert(curChar+" : "+curAscii + " : "+ maskedData); } maskedData = maskedData + '' + key; return maskedData; }