IWBH_01

code keypad

Sep 11th, 2021 (edited)
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 18.63 KB | None | 0 0
  1. <!Doctype html>
  2. <html><head>
  3.     <title>Codepad</title>
  4.     <meta charset="utf-8">
  5.     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1">
  7.  
  8. <!-- WARNING  THIS PAGE IS CURRENTLY FREEZING UP COMPUTER, NEEDS MORE DEBUGGING BEFORE IT'S USEABLE -->
  9.  
  10.     <style type="text/css">
  11.  
  12. #kbox {
  13.   width: 90%;
  14.   height: 95%;
  15.   margin-left: auto;
  16.   margin-right: auto;
  17.   border:3pt solid blue;
  18. }
  19. body {
  20.   height: 100%;
  21.   padding: 7pt;
  22.   margin: 0;
  23. }
  24. html {
  25.   height: 97%;
  26.   width: 99%;
  27.   margin-left: auto;
  28.   padding: 0;
  29.   margin-right: auto;
  30.   margin-top: 0;
  31. }
  32.  
  33. .ky{
  34.   width:10%;
  35.   height:10%;
  36.   border: 3pt solid #00a0ff;
  37.   position:relative;
  38.   float:left;
  39.   display:block;
  40.   background-color:#e0e0e0;
  41.   margin: 5pt;
  42. }
  43.  
  44. .wk{
  45.   width:10%;
  46.   height:10%;
  47.   border: 3pt solid #00a0ff;
  48.   position:relative;
  49.   float:left;
  50.   display:block;
  51.   background-color:#ffffff;
  52.   margin: 5pt;
  53. }
  54.  
  55. .ky:hover{
  56.  background-color:#a0a0a0;
  57. }
  58.  
  59. .wk:hover{
  60.  background-color:#a0a0a0;
  61. }
  62.  
  63.  
  64. #chatbox textarea {
  65.   width: 95%;
  66.   height: 40%;
  67.   font-size: 15pt;
  68. }
  69. #chatbox {
  70.   margin-left: auto;
  71.   margin-right: auto;
  72.   width: 80%;
  73. }
  74.  
  75.  
  76. </style>
  77. </head>
  78. <body>
  79.     <div id="kbox"></div>
  80.     <div id="chatbox" style="display:none"; >
  81.         <textarea id="thread" readonly></textarea><br>
  82.         <textarea id="compose"></textarea><br>
  83.         <button id="send">Send</button> &nbsp; <button id="glink" title="get the link to this chatroom aka conversation">Get Link</button> &nbsp; <button id="garble" title="Change the text in the compose box to encrypted text that looks like random letters and numbers" style="display:none";>Garble</button>
  84.     </div>
  85.  
  86.  <script type="text/javascript" id="js_aes.js">
  87.      /*
  88.  *  jsaes version 0.1  -  Copyright 2006 B. Poettering
  89.  *
  90.  *  This program is free software; you can redistribute it and/or
  91.  *  modify it under the terms of the GNU General Public License as
  92.  *  published by the Free Software Foundation; either version 2 of the
  93.  *  License, or (at your option) any later version.
  94.  *
  95.  *  This program is distributed in the hope that it will be useful,
  96.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  97.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  98.  *  General Public License for more details.
  99.  *
  100.  *  You should have received a copy of the GNU General Public License
  101.  *  along with this program; if not, write to the Free Software
  102.  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  103.  *  02111-1307 USA
  104.  */
  105.  
  106. /*
  107.  * http://point-at-infinity.org/jsaes/
  108.  *
  109.  * This is a javascript implementation of the AES block cipher. Key lengths
  110.  * of 128, 192 and 256 bits are supported.
  111.  *
  112.  * The well-functioning of the encryption/decryption routines has been
  113.  * verified for different key lengths with the test vectors given in
  114.  * FIPS-197, Appendix C.
  115.  *
  116.  * The following code example enciphers the plaintext block '00 11 22 .. EE FF'
  117.  * with the 256 bit key '00 01 02 .. 1E 1F'.
  118.  *
  119.  *    AES_Init();
  120.  *
  121.  *    var block = new Array(16);
  122.  *    for(var i = 0; i < 16; i++)
  123. *        block[i] = 0x11 * i;
  124. *
  125. *    var key = new Array(32);
  126. *    for(var i = 0; i < 32; i++)
  127. *        key[i] = i;
  128. *
  129. *    AES_ExpandKey(key);
  130. *    AES_Encrypt(block, key);
  131. *
  132. *    AES_Done();
  133. *
  134. * Report bugs to: jsaes AT point-at-infinity.org
  135. *
  136. */
  137.  
  138. /******************************************************************************/
  139.  
  140.  
  141. /*
  142.   AES_Init: initialize the tables needed at runtime. Call this function
  143.   before the (first) key expansion.
  144. */
  145.  
  146. function AES_Init() {
  147.  AES_Sbox_Inv = new Array(256);
  148.  for(var i = 0; i < 256; i++)
  149.    AES_Sbox_Inv[AES_Sbox[i]] = i;
  150.  
  151.  AES_ShiftRowTab_Inv = new Array(16);
  152.  for(var i = 0; i < 16; i++)
  153.    AES_ShiftRowTab_Inv[AES_ShiftRowTab[i]] = i;
  154.  
  155.  AES_xtime = new Array(256);
  156.  for(var i = 0; i < 128; i++) {
  157.    AES_xtime[i] = i << 1;
  158.    AES_xtime[128 + i] = (i << 1) ^ 0x1b;
  159.  }
  160.  self.AES_is_int=true;
  161. }
  162.  
  163. /*
  164.   AES_Done: release memory reserved by AES_Init. Call this function after
  165.   the last encryption/decryption operation.
  166. */
  167.  
  168. function AES_Done() {
  169.  delete AES_Sbox_Inv;
  170.  delete AES_ShiftRowTab_Inv;
  171.  delete AES_xtime;
  172.  delete AES_is_int;
  173. }
  174.  
  175. /*
  176.   AES_ExpandKey: expand a cipher key. Depending on the desired encryption
  177.   strength of 128, 192 or 256 bits 'key' has to be a byte array of length
  178.   16, 24 or 32, respectively. The key expansion is done "in place", meaning
  179.   that the array 'key' is modified.
  180. */
  181.  
  182. function AES_ExpandKey(key) {
  183.  var kl = key.length, ks, Rcon = 1;
  184.  switch (kl) {
  185.    case 16: ks = 16 * (10 + 1); break;
  186.    case 24: ks = 16 * (12 + 1); break;
  187.    case 32: ks = 16 * (14 + 1); break;
  188.    default:
  189.      alert("AES_ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!");
  190.  }
  191.  for(var i = kl; i < ks; i += 4) {
  192.    var temp = key.slice(i - 4, i);
  193.    if (i % kl == 0) {
  194.      temp = new Array(AES_Sbox[temp[1]] ^ Rcon, AES_Sbox[temp[2]],
  195.     AES_Sbox[temp[3]], AES_Sbox[temp[0]]);
  196.      if ((Rcon <<= 1) >= 256)
  197.     Rcon ^= 0x11b;
  198.     }
  199.     else if ((kl > 24) && (i % kl == 16))
  200.      temp = new Array(AES_Sbox[temp[0]], AES_Sbox[temp[1]],
  201.     AES_Sbox[temp[2]], AES_Sbox[temp[3]]);      
  202.     for(var j = 0; j < 4; j++)
  203.      key[i + j] = key[i + j - kl] ^ temp[j];
  204.  }
  205. }
  206.  
  207. /*
  208.   AES_Encrypt: encrypt the 16 byte array 'block' with the previously
  209.   expanded key 'key'.
  210. */
  211.  
  212. function AES_Encrypt(block, key) {
  213.  var l = key.length;
  214.  AES_AddRoundKey(block, key.slice(0, 16));
  215.  for(var i = 16; i < l - 16; i += 16) {
  216.    AES_SubBytes(block, AES_Sbox);
  217.    AES_ShiftRows(block, AES_ShiftRowTab);
  218.    AES_MixColumns(block);
  219.    AES_AddRoundKey(block, key.slice(i, i + 16));
  220.  }
  221.  AES_SubBytes(block, AES_Sbox);
  222.  AES_ShiftRows(block, AES_ShiftRowTab);
  223.  AES_AddRoundKey(block, key.slice(i, l));
  224. }
  225.  
  226. /*
  227.   AES_Decrypt: decrypt the 16 byte array 'block' with the previously
  228.   expanded key 'key'.
  229. */
  230.  
  231. function AES_Decrypt(block, key) {
  232.  var l = key.length;
  233.  AES_AddRoundKey(block, key.slice(l - 16, l));
  234.  AES_ShiftRows(block, AES_ShiftRowTab_Inv);
  235.  AES_SubBytes(block, AES_Sbox_Inv);
  236.  for(var i = l - 32; i >= 16; i -= 16) {
  237.     AES_AddRoundKey(block, key.slice(i, i + 16));
  238.     AES_MixColumns_Inv(block);
  239.     AES_ShiftRows(block, AES_ShiftRowTab_Inv);
  240.     AES_SubBytes(block, AES_Sbox_Inv);
  241.   }
  242.   AES_AddRoundKey(block, key.slice(0, 16));
  243. }
  244.  
  245. /******************************************************************************/
  246.  
  247. /* The following lookup tables and functions are for internal use only! */
  248.  
  249. AES_Sbox = new Array(99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,
  250.   118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,
  251.   147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,
  252.   7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,
  253.   47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,
  254.   251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,
  255.   188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,
  256.   100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,
  257.   50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,
  258.   78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,
  259.   116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,
  260.   158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,
  261.   137,13,191,230,66,104,65,153,45,15,176,84,187,22);
  262.  
  263. AES_ShiftRowTab = new Array(0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11);
  264.  
  265. function AES_SubBytes(state, sbox) {
  266.   for(var i = 0; i < 16; i++)
  267.    state[i] = sbox[state[i]];  
  268. }
  269.  
  270. function AES_AddRoundKey(state, rkey) {
  271.  for(var i = 0; i < 16; i++)
  272.    state[i] ^= rkey[i];
  273. }
  274.  
  275. function AES_ShiftRows(state, shifttab) {
  276.  var h = state.slice(); //new Array().concat(state);
  277.  for(var i = 0; i < 16; i++)
  278.    state[i] = h[shifttab[i]];
  279. }
  280.  
  281. function AES_MixColumns(state) {
  282.  for(var i = 0; i < 16; i += 4) {
  283.    var s0 = state[i + 0], s1 = state[i + 1];
  284.    var s2 = state[i + 2], s3 = state[i + 3];
  285.    var h = s0 ^ s1 ^ s2 ^ s3;
  286.    state[i + 0] ^= h ^ AES_xtime[s0 ^ s1];
  287.    state[i + 1] ^= h ^ AES_xtime[s1 ^ s2];
  288.    state[i + 2] ^= h ^ AES_xtime[s2 ^ s3];
  289.    state[i + 3] ^= h ^ AES_xtime[s3 ^ s0];
  290.  }
  291. }
  292.  
  293. function AES_MixColumns_Inv(state) {
  294.  for(var i = 0; i < 16; i += 4) {
  295.    var s0 = state[i + 0], s1 = state[i + 1];
  296.    var s2 = state[i + 2], s3 = state[i + 3];
  297.    var h = s0 ^ s1 ^ s2 ^ s3;
  298.    var xh = AES_xtime[h];
  299.    var h1 = AES_xtime[AES_xtime[xh ^ s0 ^ s2]] ^ h;
  300.    var h2 = AES_xtime[AES_xtime[xh ^ s1 ^ s3]] ^ h;
  301.    state[i + 0] ^= h1 ^ AES_xtime[s0 ^ s1];
  302.    state[i + 1] ^= h2 ^ AES_xtime[s1 ^ s2];
  303.    state[i + 2] ^= h1 ^ AES_xtime[s2 ^ s3];
  304.    state[i + 3] ^= h2 ^ AES_xtime[s3 ^ s0];
  305.  }
  306. }
  307.  
  308. //end of js_aes.js
  309.    
  310. </script>
  311.  
  312.    
  313.  <script type="text/javascript" id="algswp12_mod1.js">
  314. //changed key to type "Array()", added blocker container function, moved key check and scrambler arrays, to container function
  315. (function($){
  316.  var a12_k=null,
  317.  P_=new Uint8Array(6144),rP_=new Uint8Array(6144);
  318.  self.Ark12=function a12(dat,key,dc){ if(P)self.P2=P;  //dat must be type Uint8Array; can make by new Uint8Array(dataview.buffer||arraybuffer)
  319.  var i,j=0,dL=dat.length,dL2=dL<<1,b,c,P=P_,rP=rP_,g12a4=a12.g12a4,s12a4=a12.s12a4,d,e,f,g,h,m,n; if(key&&(a12_k!=key)){ i=4096; while(i--)s12a4(P,i*3,i);
  320. while(i<key.length){ //scramble array with key
  321.  if(!d){d=!0;f=key[i];g=key[(i+1)%key.length];}
  322.  c=(((Math.cbrt(f*g)+((f^g)*(i+1))+((Math.sin((Math.PI*(f+g)/255)+j)+1)*j/7))<<0)+j)%4096;
  323.  
  324.  b=g12a4(P,h=j*3);s12a4(P,h,g12a4(P,m=c*3));s12a4(P,m,b);
  325.  j++;if(j>=4096){j=0;i++;d=!1;}
  326.  }
  327.  i=4096; while(i--)s12a4(rP,g12a4(P,i*3)*3,i);
  328.  a12_k=key.join(",");}
  329.  
  330.  if(dc){i=dL2;
  331.   while(i--){
  332.    n=g12a4(dat,i)^g12a4(dat,i+dL);s12a4(dat,i,g12a4(rP,n*3));
  333.   }
  334.  }else{i=0;
  335.   while(i<dL2){
  336.   n=g12a4(dat,i);s12a4(dat,i,g12a4(P,n*3)^g12a4(dat,i+dL));
  337.   i++;
  338.  }
  339. }
  340. return dat;
  341. }; Object.assign(self.Ark12,{"g12a4":function get12BitAtIndx4(u8a,i4){ var aL=u8a.length,i8=(i4>>1)%aL,b1=u8a[i8],b2=u8a[(i8+1)%aL];
  342. return i4&1?(((b1&15)<<8)+b2):((b1<<4)+(b2>>4)); },
  343. "s12a4":function set12BitAtIndx4(u8a,i4,n){ var aL=u8a.length,i8=(i4>>1)%aL,Lm=(i8+1)%aL,b;
  344. if(i4&1){ b=u8a[i8];u8a[i8]=(b&240)+(n>>8);u8a[Lm]=n&255; }else{ u8a[i8]=n>>4;b=u8a[Lm];u8a[Lm]=((n&15)<<4)+(b&15); }}
  345. });
  346.  
  347. })(self);
  348.  //end of algswp12_mod.js
  349.  </script>
  350.  
  351.    
  352.  <script type="text/javascript" id="main_codepad.js">
  353. AES_Init();
  354.  
  355.  
  356.  
  357. var strNui8=function strNui8(s,ui8,u8i){
  358.  var L=s.length,i=L; u8i=u8i||0;
  359.   while(i--) ui8[u8i+i]=s.charCodeAt(i);
  360. },
  361.  
  362. ui8Gstr=function Ui8Gstr(ui8,i,L){
  363.  var s="";
  364.   while(i!=L){ s+=String.fromCharCode(ui8[i]); i++; }
  365.   return s;
  366. },
  367.  
  368. BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
  369.  
  370. btuaBuf=function btoaUrlsafeBuffer(buf){ if(!buf) return ""; //must be uint8array
  371.  var L=buf.byteLength,i=0,nom=0,out="",bitL=0;
  372.  while(i<L){
  373.  if(bitL<6){ nom=(nom<<8)|buf[i]; i++; bitL+=8; }
  374.  bitL-=6;
  375.  out+=BASE64[nom>>bitL];  nom&=(65535>>(16-bitL));
  376.  }
  377.  if(bitL>0) out+=BASE64[nom<<(6-bitL)];
  378. return out;
  379. },
  380.  
  381. atubBuf=function atobUrlsafeBuffer(str){ if(!str) return out=new Uint8Array(0);
  382. while(BASE64.indexOf(str[str.length-1])<0) str=str.substr(0,str.length-1);
  383. var L6=str.length, L8=Math.floor(L6*0.75), out=new Uint8Array(L8),i8=0,i6=0,nom=0,bitL=0;
  384. while(i8<L8){
  385.  if(bitL<8){ bitL+=6; nom=(nom<<6)|BASE64.indexOf(str[i6]); i6++; }
  386.  else{ bitL-=8; out[i8]=nom>>bitL; nom&=(65535>>(16-bitL)); i8++; }
  387.  }
  388.  return out;
  389. };
  390.  
  391.  
  392.      
  393.   var d=document,cE="createElement",aC="appendChild",gI="getElementById",gTN="getElementsByTagName",cW="clientWidth",cH="clientHeight",aEL="addEventListener",
  394.   kbox=d[gI]("kbox"), cbox=d[gI]("chatbox"), txta=cbox[gTN]("textarea"), btns=cbox[gTN]("button"),
  395.   kc=40;
  396.   while(kc--) (kbox[aC](d[cE]("button"))).className="ky";
  397.  
  398.   var kbc=Array.from(kbox.children), k0=kbc[0], hadz=Math.floor(kbox[cW]/(k0[cW]+20))*Math.floor(kbox[cH]/(k0[cH]+20)), wkL=hadz-40;
  399.   if(wkL>0){
  400.     while(wkL--){ kbox.insertBefore(d[cE]("button"),kbc[Math.floor(Math.random()*40.9)]).className="wk"; }
  401.    }
  402.  
  403.  (function(){ //keymake
  404.   /*
  405.   if(location.href.indexOf("data:text/html")==-1){  var a1=d[cE]("a"); a1.href="data:text/html;base64,"+btoa(d.documentElement.outerHTML.replace('self.loc'+'ation.href.split("#")[0]','"'+self.location["href"].split("#")[0]+'"')+"#"+location.hash); a1.innerText="click here to open this page as dataurl, (it's you're only option)"; d.body.innerHTML=""; d.body[aC](a1); return 0; }
  406.   */
  407.  
  408.   var cyak,TOKEN,roomn,xhr=new XMLHttpRequest(),xhrBL=[],xhr_load=function(e){ if(e&&xhrBL[0]&&xhr.requ==xhrBL[0][1]){ xhr.requ=""; var c=xhrBL.shift(),b; if(c&&typeof c[0]=="function")c[0](xhr.response); }
  409.       if(xhrBL.length&&xhr.readyState%4==0){ b=xhrBL[0];  xhr.open(b[3]||"GET",xhr.requ=b[1]); xhr.responseType=b[2]||"text"; xhr.send(b[4]); }
  410.       //xhrBL = [callback, url, responseType, Method, body]
  411.   };
  412.      xhr[aEL]("loadend",xhr_load);
  413.      if(location.hash){ TOKEN=(LH=location.hash.split("&"))[0]; roomn=LH[1]; cyak=atubBuf(roomn); }
  414.   else{
  415.     cyak=new Uint8Array(32);
  416.     var Li=0,Bo=16,r1,c2=new Uint16Array(cyak.buffer);
  417.     while(Li!=Bo){c2[Li]=(Math.random()*65535)&65535; Li++}
  418.     roomn=btuaBuf(cyak);
  419.     xhrBL.push([function(r){ r=r.substr(r.indexOf("FREE TOKENS ")); TOKEN=(/[0-9a-f][0-9a-f]*/g).exec(r.substr(r.indexOf("\n")))[0];},"https://www.meeiot.org/?p=code.php"]);
  420.     xhr_load();
  421.   }
  422.      
  423.   var kyee=Array.from(kbox.getElementsByClassName("ky")),
  424.   krz=Array.prototype.slice.call(cyak),
  425.   kaak=function(n){
  426.    n=(krz[n&31]^=n);n=(krz[(n+krz[n&31])&31]^=n);n=(krz[(n*krz[n&31])&31]^=n);n=(krz[Math.pow(n,5/(1+krz[n&31]))&31]^=n);
  427.    n=(krz[n&31]^=n);n=(krz[(n+krz[n&31])&31]^=n);n=(krz[(n*krz[n&31])&31]^=n);n=(krz[((Math.sin(n/18)+1)*31.5)&31]^=n);
  428.    n=(krz[n&31]^=n);n=(krz[(n+krz[n&31])&31]^=n);n=(krz[(n*krz[n&31])&31]^=n);n=(krz[Math.pow(n,5/(1+krz[n&31]))&31]^=n);
  429.    n=(krz[n&31]^=n);n=(krz[(n+krz[n&31])&31]^=n);n=(krz[(n*krz[n&31])&31]^=n);n=(krz[((Math.sin(n/18)+1)*31.5)&31]^=n);
  430.   },
  431.   shf=0,LLT=0,dtmt,lstnr=function(e){
  432.    var ct=(new Date()).getTime(); if((ct-LLT)<30){ return 0; } //multi-event discount
  433.   clearTimeout(dtmt); dtmt=setTimeout(onWhenDone,9000); //after 45 seconds of no typeing
  434.   //this is gonna be weird (the key doesnt acutally exist, but I works like it does)
  435.   var tar=e.target||e.srcElement;
  436.   if(tar.className=="ky"){ var ki=kyee.indexOf(tar);
  437.    if(ki==39) shf=(shf+1)%3;
  438.    else{ kaak((shf*39)+ki); if(shf)shf=0; }
  439.   }
  440.    self.krz_=krz; //leak debug ONLY   //String.fromCharCode(96+(krz[i]-9)) or String.fromCharCode(65+(krz[i]-48))
  441.  };
  442.  kbox[aEL]("click",lstnr);
  443.  kbox[aEL]("ontouchstart",lstnr); //do I need this?
  444.    
  445.  
  446.  
  447.  //do something to detect when user is done typeing, then format the key:
  448.  
  449.  var letL=50, chckmsg,
  450.  dif,krz2,
  451.  onWhenDone=function(){;
  452.  krz2=krz.slice();
  453.  AES_ExpandKey(krz2); //expanded, krz is not expanded
  454.  
  455.   kbox.style.display="none";
  456.   cbox.style.display="";
  457.   var ts=d[cE]("span"); ts.style.fontSize="15pt"; ts.style.fontWeight="bold";
  458.   d.body[aC](ts); ts.innerHTML="_@";
  459.   letL=((txta[0].offsetWidth/ts.offsetWidth)*2)-5;
  460.   d.body.removeChild(ts);
  461.  
  462.   chckmsg=setInterval(chk4Msg,3000);
  463.  };
  464.  
  465.  var mi=0,LH, LM,   //mi = message index?; LM =Last Message
  466.      
  467.  doCry=function doubleCrypto(dat,de){ //dat==arraybuffer of data, de=decode mode (bool false or null==off)
  468.     //make new Uint8Array(dat,byteindex (increment by 16), 16 (length is always 16 byte blocks))
  469.     Ark12(new Uint8Array(dat),krz,de)&&0;
  470.     var i=0,L=dat.length,L5=L-15,df=L%16, Crypt=de?AES_Decrypt:AES_Encrypt;
  471.     if(de&&df) Crypt(new Uint8Array(dat,L-16,16),krz2);
  472.     while(i<L5){ Crypt(new Uint8Array(dat,i,16),krz2); i+=16; }
  473.     if((!de)&&df) Crypt(new Uint8Array(dat,L-16,16),krz2); //extra if length not evenly divisible by 16
  474.     return dat;
  475.  },
  476.  
  477.  //begin meeiot channel section
  478.  
  479.  anyData=function AnyData(opr,dat,cb){
  480.   //use get/set; push/pop note pop removes from index zero (nice) so if you put a1 a2 a3 on push in that order, a1 will come off first on the next "pop";  use lst to read what will come off pop next without removing it.
  481.   xhrBL.push([cb,"http"+"s:"+"/"+"/www.meeiot.org/"+opr+"/"+TOKEN+"/"+dat]);
  482.   xhr_load();
  483.  },
  484.  
  485.  sendMsg=function sndMs(d){
  486.   if(typeof d!="string")d=txta[1].value;
  487.   while(d.length>700){ sndMs(d.substr(0,700)); d=d.substr(700); } //break up
  488.    var u8=new Uint8Array(d.length),ed;
  489.    strNui8(d,u8);
  490.    doCry(u8.buffer)&&0;
  491.    anyData("put",roomn+"="+(LM=btuaBuf(u8)));
  492.    dsplyMsg(d);
  493.   },
  494.  
  495.   dsplyMsg=function DisplayMessage(m){ m=m.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
  496.    var aag=m.split("\n"),aL=aag.length,mL=m.length,a2,s,i=0;
  497.    //while(i!=aL){ s=aag[i]; if(s.length>letL){ a2=[]; while(s.length){ a2.push(s.substr(0,letL)); s=s.substr(letL); } aag[i]=a2;  } i++;}
  498.    //aag=aag.flat(2);
  499.    i=letL; s=""; while(i--){ s+="_"; }
  500.    txta[0].value+=s+"__\n|"+aag.join("|\n|")+"|\n|"+s+"|\n\n";
  501.   },
  502.   onRcvMsg=function(r){ if(r!=LM){var bu=atubBuf(r); if(bu.length){ doCry(bu.buffer,1)&&0; dsplyMsg(ui8Gstr(bu,0,bu.length)); } } },  
  503.  
  504.   chk4Msg=function(){ var L_=xhrBL[xhrBL.length-1];
  505.    if((!L_)||(L_[0]!=onRcvMsg)) anyData("get",roomn,onRcvMsg);
  506.   };
  507.  
  508.   btns[0][aEL]("click",sendMsg);
  509.  
  510.   btns[1][aEL]("click",function(){ var L=self.location.href.split("#")[0]; alert(L+"#"+TOKEN+"&"+roomn); });
  511.  
  512.   //xhrBL.push([function(r){ mi=r.split(",")[0]*1; },"https://www.meeiot.org/get/"+TOKEN+"/"+roomn+"_"]);
  513.  })();
  514.  
  515.  
  516.   alert("Please note, any white keys are fake - skip over them when counting; the light grey keys are left-to-right top-to-bottom sequential in the following order: 0 through 9, a through z, space, period, questionmark, shift.\n\nJust press shift (the last grey key) once to turn the next letter you press into it's uppercase equivilent, and numbers into their standard keyboard symbols in this order )!@#$%^&*(\n space becomes underscore _ period comma, and questionmark forward slash /\npress shift a 2nd time without pressing another key first and it will be 2nd shift, that is all the remaining keyboard symbols starging from key 0 in this order `~-+=[]{}\\|;:'\"<>\nThe keys will not change color when you press them, only when you hover the mouse over them. There is no caps lock unfortunately, you have to press shift before for every capital letter. There is no backspace so be careful if you mistype you will have to reload the page and try again from the beggining.");
  517.  
  518.  
  519.  
  520.  </script>
  521. </body></html>
Add Comment
Please, Sign In to add comment