Advertisement
EzFlow997

Encrypter HTML Example

Jun 6th, 2024
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 8.15 KB | Source Code | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en" oncontextmenu="return false">
  3. <head>
  4.     <title>Sample</title>
  5. </head>
  6. <body oncontextmenu="return false">
  7.     <input type="text" id="text_input_1" name="myInput" size="30" required><br>
  8.    
  9.     <button type="button" id="button_1" name="myButton">Encrypt Text</button> <br>
  10.     <strong id="text_output_1">This text is bold</strong><br>
  11.  
  12.     <button type="button" id="button_2" name="myButton">Decrypt Text</button><br>
  13.     <strong id="text_output_2">This text is bold</strong><br>
  14.    
  15.     <script>
  16.         let data =  {33:{1:"374Bf1@B", 2:"YDv$Cx", 3:"S38aZp", 4:"8OZQP5", 5:"D9B!!Fe"}
  17.             ,35:{1:"wwrNBiP5EB", 2:"YJBK!K!@", 3:"3YAl#ciep", 4:"qjD!BjXekD", 5:"XQSZ7s"}
  18.             ,36:{1:"W?Xx07RkDM", 2:"Thlckka?&", 3:"X4tM#UWuXR", 4:"R??Jvz!l$", 5:"y5ixnUb"}
  19.             ,37:{1:"EDsi&SNRF", 2:"Ma11Dgh", 3:"rq&Gf$C", 4:"!EutYFXX&b", 5:"I02A1Q"}
  20.             ,38:{1:"8gCHR?CN&", 2:"va@aE#", 3:"Js!9!OO", 4:"A&$li?7L", 5:"ytnwJacqB"}
  21.             ,48:{1:"$&2iee", 2:"eZ?KYf", 3:"&Pq3rJo", 4:"TfFR6oIb", 5:"Xbpcu6F6t"}
  22.             ,49:{1:"%RqUfj", 2:"dZIvPuVnJ", 3:"laN2cuM&", 4:"Myg3z0wJcP", 5:"#Vq8T9%Zn!"}
  23.             ,50:{1:"RUwOm%7R", 2:"G4t&ib", 3:"!UemLUEVdR", 4:"HlL?DV", 5:"vfGKXN"}
  24.             ,51:{1:"umr!?I!J", 2:"7n63oR", 3:"&MC72?", 4:"72f$A1v", 5:"FiyB2FuzGA"}
  25.             ,52:{1:"W$ahRf", 2:"ZRLafA4", 3:"jM%ozceVS", 4:"B4rYFo@42", 5:"c$x7X?a"}
  26.             ,53:{1:"GaBoadbb", 2:"ew1%5e", 3:"F1$n2NSI4", 4:"jzSvgk@wO", 5:"21aEN%T"}
  27.             ,54:{1:"Q$hTEoEMqs", 2:"#p!Ata", 3:"SjYsb%w", 4:"rbdvd9", 5:"PKlSogWDU"}
  28.             ,55:{1:"&BE?f5L2", 2:"C&N?29FT", 3:"0y6%h82?", 4:"vArjvFb", 5:"j0$vHT2W#D"}
  29.             ,56:{1:"fbwfHI", 2:"lhIdZYv@y", 3:"K93MCtsS", 4:"JZM6KnMr8", 5:"&J#kmAg"}
  30.             ,57:{1:"&jStbmT", 2:"w?36gR2O", 3:"!cAVli??3", 4:"cZupwgFn", 5:"!%@ayg"}
  31.             ,63:{1:"JSdI7ldX5", 2:"gDGX3ofrN", 3:"?padlgB7J", 4:"mBj?oF", 5:"2DYXj#"}
  32.             ,64:{1:"kthU@oV", 2:"SG16y%&jK", 3:"hTgZ%%8$", 4:"riMxTMe9x", 5:"?rz?RJ"}
  33.             ,65:{1:"vMCE8uG?", 2:"gTb!gD$B", 3:"csIrp1?kb", 4:"NHqBv$z5jK", 5:"MG1F0Y1J7d"}
  34.             ,66:{1:"OcaD&wiH", 2:"T%ss!?", 3:"AilUHtyfE", 4:"JVZF%HGA", 5:"GMkHVZ"}
  35.             ,67:{1:"@eOciwnWx6", 2:"tcEkrM", 3:"Vqx$?jdD15", 4:"uv7msFPM", 5:"nVWvQCyMU"}
  36.             ,68:{1:"Vgo4OJ&", 2:"7EixnzT", 3:"MDYVUUG", 4:"?4ip3P", 5:"JjMpTZu"}
  37.             ,69:{1:"pqsrwnS", 2:"q@msR#", 3:"l#N4B1LE", 4:"TefbRHXVG", 5:"zz$Ps7"}
  38.             ,70:{1:"dPKD0ot", 2:"Zqkd@2p", 3:"tN84HuK2", 4:"7@CTnI5r", 5:"WRIwLo3Xu"}
  39.             ,71:{1:"2hjlgTU", 2:"8K$P&Bo@F", 3:"DnC5WSOL", 4:"2oEcbX", 5:"r2Z%4e??sE"}
  40.             ,72:{1:"eWQTp4w", 2:"zl3EF1wW", 3:"TCreox", 4:"%flto3t", 5:"bm?S?AtUXr"}
  41.             ,73:{1:"%18IxJV#YI", 2:"1m8h3Y?Z?!", 3:"!Ues32Z", 4:"O%quiJFg", 5:"oZwIjd"}
  42.             ,74:{1:"wPc%CB?I", 2:"LTzP8ep", 3:"?ScmAIJFS", 4:"i3Mp?U", 5:"brNWcj"}
  43.             ,75:{1:"Ow?kZbE", 2:"PLL6!YWVm?", 3:"C6fvytI?i", 4:"x9wsHbhU", 5:"W18O&paF"}
  44.             ,76:{1:"1XLIn&e@", 2:"R&WScG", 3:"EQar#VuRvp", 4:"5GiUbI", 5:"e8k6Rbsh"}
  45.             ,77:{1:"RNitK#xf", 2:"%J?uCtb&A?", 3:"Ofmh7bjuZ", 4:"!1pCPb?", 5:"oDQf0f"}
  46.             ,78:{1:"NXZAT9", 2:"q1a9NA?wG", 3:"wm6@FDpren", 4:"GLrvAmox", 5:"SJ#BYA#b"}
  47.             ,79:{1:"skruuOu", 2:"#Q&Px?w", 3:"ec4wiA", 4:"jXDG@w!nW&", 5:"ugrJ!a?7"}
  48.             ,80:{1:"tf!mMEzMmU", 2:"JmCgQMjy", 3:"uF!x!sxJW2", 4:"IL9i4O8K", 5:"9ACw?V"}
  49.             ,81:{1:"mnMCAUygeq", 2:"vD$3DP", 3:"4VStuCTk", 4:"GRnwCakpW", 5:"U$6Tpm8Yy"}
  50.             ,82:{1:"U9jI%K!", 2:"iU?5g7V$Bl", 3:"EgHx%1i", 4:"GLB!FnTE", 5:"CPJObHxA?Y"}
  51.             ,83:{1:"MBm6DtHIn", 2:"toEJRTzf4", 3:"6y4%im", 4:"cbp@9AULuc", 5:"MuPv0do"}
  52.             ,84:{1:"vdpB?Fy7ci", 2:"C1yqRHqA", 3:"G3FYldJs", 4:"#dSFbR", 5:"ahAODEXmE"}
  53.             ,85:{1:"N00$LJJVW", 2:"FZXcqk", 3:"9IbGoOVukv", 4:"gCNdBx", 5:"X%Erv3x?"}
  54.             ,86:{1:"wq9C9tV#M", 2:"cmJsPg5s", 3:"WKDdYYn", 4:"Li7ft#4", 5:"xUnE?JbfZt"}
  55.             ,87:{1:"Lp0V7QW$", 2:"Uws7O2EPV", 3:"ep?u&nJk", 4:"6Ac8LWe$", 5:"evH9c&5rp"}
  56.             ,88:{1:"G4p%0S?R", 2:"tJ%k#CyqQg", 3:"ukEX1j", 4:"eCYl58UH", 5:"E#jv$W"}
  57.             ,89:{1:"Gi0?XU?z", 2:"ueh111P@", 3:"fxQZ1@ls?", 4:"Cbo8spK", 5:"Fi7SRA5"}
  58.             ,90:{1:"bqddaLear", 2:"5ua$PMV", 3:"kyBdJ8s?A", 4:"wuyKUBirse", 5:"BIzih7o"}
  59.             ,97:{1:"pzzZfPtB6H", 2:"&2Hr!g&y", 3:"SCllR2p12", 4:"kuWzMQM", 5:"rCsPe8B1G"}
  60.             ,98:{1:"O&g&DM", 2:"J0jdc0rf", 3:"KAiOUfByLL", 4:"EC$h8Tg3V", 5:"oaKEWkdg"}
  61.             ,99:{1:"ZNy9#%", 2:"lvY570wlM", 3:"FQVo0VRqYY", 4:"tRu%N&", 5:"bpuePV"}
  62.             ,100:{1:"bJu7WUmsm", 2:"gGAW!?", 3:"zisjgh&F", 4:"4kL#J87Y&O", 5:"RG1#$khLNi"}
  63.             ,101:{1:"gcdsuWQ", 2:"!qjx#&6", 3:"#R$snkg", 4:"EyL03!M", 5:"PjXDQoXLf3"}
  64.             ,102:{1:"GQZ7BbEnpi", 2:"B$9LH8E4YQ", 3:"&ZpLRvo894", 4:"N6ERLQ", 5:"ZBsXfu"}
  65.             ,103:{1:"b1QJauw", 2:"sn&gm4Ox", 3:"dZ!dl6", 4:"2uo8S?", 5:"NK&Sz2@pAE"}
  66.             ,104:{1:"warnp1ZsUi", 2:"9m?bwI", 3:"PMaLFwP5&!", 4:"uGGg!z", 5:"TarhVxoQQL"}
  67.             ,105:{1:"1?4jQmKO?", 2:"dC9ZyNf", 3:"Z1yMJr", 4:"lNy9jJ", 5:"yd@PLk8W"}
  68.             ,106:{1:"neYUPF4", 2:"JLC%CVlQ", 3:"s2q1geacS", 4:"rDk$ax4e", 5:"r3@M2%wi"}
  69.             ,107:{1:"Ml4LSEio", 2:"#MQmPVi", 3:"y&c@eAg", 4:"2WA3DhYuXn", 5:"oTlFCV"}
  70.             ,108:{1:"sYoiUM", 2:"wsWW&C", 3:"33aV&H4", 4:"@dfbYQy", 5:"xXwkzCg5"}
  71.             ,109:{1:"0DcHtE?Gj", 2:"12n$GgTZ", 3:"V46vmD", 4:"kJ%xxtyy", 5:"2?SYOr"}
  72.             ,110:{1:"NMGc7$P?Av", 2:"TVFMCr!kV", 3:"a!YuikY", 4:"WsA4&kY0", 5:"yaTYlidJ"}
  73.             ,111:{1:"P3wpxPc", 2:"Qlvyoyz9!", 3:"UAMu@6S$k", 4:"HQrk02cbU", 5:"8gJOkn"}
  74.             ,112:{1:"@$kPlq", 2:"HVWM8M#hmL", 3:"QDTOyGYBW0", 4:"0f5Lidi", 5:"8BwmeO7H"}
  75.             ,113:{1:"$GCOG@", 2:"y0OhW0", 3:"1?QxbuAIzo", 4:"K91S#V", 5:"1xcB7S%n"}
  76.             ,114:{1:"#gCxPkZw", 2:"71OqbmeD", 3:"Zb?v9Kpb#", 4:"LRM?u6w?cU", 5:"ASGLI?C"}
  77.             ,115:{1:"?3m1H!ty", 2:"X&I%hV!", 3:"E?6ODP", 4:"AS?r%Mly@m", 5:"6YgE??B$G"}
  78.             ,116:{1:"ibe1t&MCvk", 2:"i57m0d%$", 3:"fPa9fIr", 4:"ZTGA4Q", 5:"QCNxkf?"}
  79.             ,117:{1:"0EN6lGl", 2:"8R0MCaRD", 3:"4LIPHmaUhv", 4:"qpl4BDCj", 5:"?HApSW"}
  80.             ,118:{1:"kt!Nroj", 2:"0XuBvkv", 3:"?FU24&", 4:"$d@tVaSj", 5:"IpljqbjBf"}
  81.             ,119:{1:"6GW4wRia", 2:"y9EZ7R", 3:"Za!RQjlQ", 4:"bzQ!eZB", 5:"oCWFImi"}
  82.             ,120:{1:"e2?FLh", 2:"DWhxS9agB", 3:"nTYRJog", 4:"zO@J45G", 5:"!hBR?T"}
  83.             ,121:{1:"&ODnMIRDs", 2:"x4@14A", 3:"9yHomk4", 4:"H&2ncD", 5:"dpkHqR"}
  84.             ,122:{1:"lhtTmr", 2:"PLWJhZC", 3:"xDa3N9K6J7", 4:"6w!!WE4", 5:"fv4uEYdxm8"}}
  85.            
  86.         let illegal_characters = [34, 39, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 91, 92, 93, 94, 95, 96, 123, 124, 125, 126, 127];
  87.  
  88.         let encrypted_text = "";
  89.         let decrypted_text = "";
  90.         let encrypting = false;
  91.         let decrypting = false;
  92.        
  93.         document.getElementById("button_1").onclick = function(){
  94.             //console.log("ENCRYPT");
  95.             let inText = document.getElementById("text_input_1").value;
  96.             console.log(inText);
  97.             encrypt_text(inText);
  98.             while(encrypting == true);
  99.             document.getElementById("text_output_1").innerHTML = encrypted_text;
  100.             console.log(encrypted_text);
  101.         }
  102.        
  103.         document.getElementById("button_2").onclick = function(){
  104.             console.log(encrypted_text);
  105.             decrypt_text(encrypted_text);
  106.             while(decrypting == true);
  107.             document.getElementById("text_output_2").innerHTML = decrypted_text;
  108.             console.log(decrypted_text);
  109.         }
  110.        
  111.         function encrypt_text(in_text){
  112.             encrypting = true;
  113.             encrypted_text = "";
  114.      
  115.             for(let i = 0; i < in_text.length; i++){
  116.                 let c = in_text[i].charCodeAt(0);
  117.                 let random_pick = (1 + (Math.random()*4)).toFixed(0);
  118.                 encrypted_text = encrypted_text + data[c][random_pick];
  119.             }
  120.             encrypting = false;
  121.         }
  122.        
  123.         function decrypt_text(in_text){
  124.             decrypting = true;
  125.             decrypted_text = "";
  126.      
  127.             let decrypters_chunk = [];
  128.             let decrypters_character = [];
  129.      
  130.             for(let i = 32; i < 134; i++){ // iterate through characters
  131.                 for(let j = 1; j < 6; j++){ // iterate through 5 data samples
  132.                     if(data[i] != undefined){
  133.                         if(data[i][j] != undefined){
  134.                             let encrypt = data[i][j];
  135.                             let temp = in_text;
  136.                             while(temp.indexOf(encrypt) > -1){
  137.                                 console.log(temp);
  138.                                 decrypters_chunk.push(encrypt);
  139.                                 decrypters_character.push(String.fromCharCode(i))
  140.                                 temp = temp.replace(encrypt, "");
  141.                             }
  142.                         }
  143.                     }
  144.                 }
  145.             }
  146.            
  147.             while(decrypters_chunk.length > 0){
  148.                 for(let i = 0; i < decrypters_chunk.length; i++){
  149.                     let encrypt = decrypters_chunk[i];
  150.                     if(in_text.indexOf(encrypt) == 0){
  151.                         decrypted_text = '' + decrypted_text + '' + decrypters_character[i];
  152.                         in_text = '' + in_text.slice(encrypt.length, in_text.length + 1);
  153.                         decrypters_chunk.splice(i,1);
  154.                         decrypters_character.splice(i,1);
  155.                         break;
  156.                     }
  157.                 }
  158.             }
  159.             decrypting = false;
  160.         }
  161.     </script>
  162. </body>
  163. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement