Encode Decode String using Javascript
Encode Decode String using Javascript
Encode Decode String using Javascript
A classic script which uses a code or key to encode and is nearly impossible to decode, even when using frequency analysis. This script is also entertaining since you can actually see the encryption taking place
<!-- STEP One: Copy this code into the HEAD section of your HTML document --> <script LANGUAGE="JavaScript"> var TID = 0; var longer = 0; var thirdwrite = ""; var alphabet = new Array("[email protected]","1#","2$","3%","4^","5&","6*","7 = ","8-","9+","Aa","Bb","Cc","Dd","Ee","Ff","Gg","Hh","Ii","Jj","Kk","Ll","Mm","Nn","Oo","Pp","Qq","Rr","Ss","Tt","Uu","Vv","Ww","Xx","Yy","Zz"); function preTime(coco, uinput, question) { longer = coco.length - 1; placement = 0; ref = 0 ; secondWrite = ""; firstWrite = ""; thirdWrite = ""; code1(coco, uinput, longer, question); } function findshift(letter) { for (i = 0; i < 36; i++) { if ((alphabet[i].substring(0,1) == letter) || (alphabet[i].substring(1,2) == letter)) { if (alphabet[i].substring(0,1) == letter) { x = 0; } if (alphabet[i].substring(1,2) == letter) { x = 1; } return i; } } } function check(letter) { bill = "no"; for (i = 0; i < 36; i++) { if ((alphabet[i].substring(0,1) == letter) || (alphabet[i].substring(1,2) == letter)) { bill = "yes"; } } if (bill == "yes") { return true; } else { return false; } } function fixoffset(takin) { if (takin > 35) { return (takin - 36); } else { return takin; } } function code1(inval1,inval2,inval3,sage) { if (check(inval2.charAt(placement))) { if (check(inval1.charAt(ref))) { if (sage == 0) { shift = findshift(inval1.charAt(ref)); } if (sage == 1) { shift = 36 - findshift(inval1.charAt(ref)); } } else { shift = 0; } orig = findshift(inval2.charAt(placement)); firstWrite = firstWrite+alphabet[fixoffset(orig+shift)].charAt(x); } else { firstWrite = firstWrite+inval2.charAt(placement); } secondWrite = inval2.substring(placement+1,inval2.length+1); thirdWrite = firstWrite+secondWrite; document.inputo.written.value = thirdWrite; placement++; if (ref == inval3) { ref = 0 } else { ref++; } if (placement == (inval2.length)) { window.clearTimeout(TID); return false; } one = inval1; two = inval2; three = inval3; goer = sage; TID = window.setTimeout("code1(one, two, three, goer)", 0); } </script> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <body> <center> <form name="inputo"> <textarea name=written rows=12 cols=40>Type message to encode here</textarea> <br /> Code Phrase:<input type=text name=codeWord value="code phrase here"/> <input type=button value="Encode" onClick="preTime(codeWord.value,written.value, 0);"/> <input type=button value="Decode" onClick="preTime(codeWord.value,written.value, 1);"/> </form> </center>
Incoming search terms:
- javascript decode online (4)
- javascript html entity encode online encoder (2)
- javascript decode string (2)
- online decoder js (2)
- javascript encoder online (2)
- online js decoder (2)
- online decoder js script (1)
- javascript string decoder (1)
- javascript stringdecoder (1)
- javascript string_decode (1)
- javascript \x code encode decode (1)
- remove scrolling when decode javascript (1)
- remove scrolling on encode javascript (1)
- javascriptstringencode parse (1)
- js decoder online (1)
- js encode online (1)
- js string decoder online (1)
- MIST encoding (1)
- online decode javascript string (1)
- online decoder javascript (1)
- js php encode decode (1)
- uu encode decode javascript (1)
- javascript html encoding online (1)
- alphabet to [email protected] (1)
- décodage script js (1)
- decode encoded html using javascript (1)
- decode html encoded string javascript (1)
- decode js (1)
- decoder js (1)
- decrept javascript (1)
- encode and decode in javascript (1)
- encode decode string in javascirpt (1)
- how to encode and decode the string in jquery (1)
- html decode javascript string (1)
- javascript decodage string (1)
- javascript decode html (1)
- javascript decoder online (1)
- javascript encode online (1)
- javascript encode php decode (1)
- decode javascript online (1)