diff --git a/dist/web/assets/index-D1eiXWSf.js b/dist/web/assets/index-D1eiXWSf.js new file mode 100644 index 0000000..d232fbc --- /dev/null +++ b/dist/web/assets/index-D1eiXWSf.js @@ -0,0 +1,4 @@ +(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))h(d);new MutationObserver(d=>{for(const b of d)if(b.type==="childList")for(const s of b.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&h(s)}).observe(document,{childList:!0,subtree:!0});function f(d){const b={};return d.integrity&&(b.integrity=d.integrity),d.referrerPolicy&&(b.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?b.credentials="include":d.crossOrigin==="anonymous"?b.credentials="omit":b.credentials="same-origin",b}function h(d){if(d.ep)return;d.ep=!0;const b=f(d);fetch(d.href,b)}})();const w={3:{unifier:"­",0:"᠎",1:"​",2:"‍"},6:{unifier:"‌",0:"‍",1:"‏",2:"­",3:"⁠",4:"​",5:"‎"},8:{unifier:"‌",0:"‍",1:"‏",2:"­",3:"⁠",4:"​",5:"‎",6:"᠎",7:"\uFEFF"},encodeString:(i,r=3)=>Array.from(i,f=>f.codePointAt(0).toString(r).split("").map(h=>w[r][h]).join("")).join(w[r].unifier),encodeNumberArray:(i,r=3)=>i.map(f=>f.toString(r).split("").map(h=>w[r][h]).join("")).join(w[r].unifier),decodeToString:(i,r=3)=>i.split(w[r].unifier).map(f=>String.fromCodePoint(parseInt(Array.from(f).map(h=>Object.keys(w[r]).find(d=>w[r][d]===h)).join(""),r))).join(""),decodeToNumberArray:(i,r=3)=>i.split(w[r].unifier).map(f=>parseInt(Array.from(f).map(h=>Object.keys(w[r]).find(d=>w[r][d]===h)).join(""),r))};function J(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var R,_;function Q(){if(_)return R;_=1;function i(r={}){const f=r.bits||16,h=r.rounds||22,d=r.rightRotations||7,b=r.leftRotations||2,s=2**f,l=s-1,a=(o,t)=>o>>t|o<o<>f-t,k=(o,t,e)=>(o=a(o,d),o=o+t&l,o^=e,t=m(t,b),t^=o,[o,t]),A=(o,t,e)=>(t^=o,t=a(t,b),o^=e,o=o-t&l,o=m(o,d),[o,t]);function I(o,t){let e=o[0],c=o[1],n=t[0],p=t.slice(1);[c,e]=k(c,e,n);for(let g=0;g{const c=o([t/s|0,t&l],e);return c[0]*s+c[1]}}return{encrypt:u(I),decrypt:u(E),encryptRaw:I,decryptRaw:E}}return R=i,R}var W=Q();const x=J(W);var F,j;function L(){if(j)return F;j=1;const i="Input must be an string, Buffer or Uint8Array";function r(s){let l;if(s instanceof Uint8Array)l=s;else if(typeof s=="string")l=new TextEncoder().encode(s);else throw new Error(i);return l}function f(s){return Array.prototype.map.call(s,function(l){return(l<16?"0":"")+l.toString(16)}).join("")}function h(s){return(4294967296+s).toString(16).substring(1)}function d(s,l,a){let m=` +`+s+" = ";for(let k=0;k=4294967296&&g++,e[c]=p,e[c+1]=g}function f(e,c,n,p){let g=e[c]+n;n<0&&(g+=4294967296);let y=e[c+1]+p;g>=4294967296&&y++,e[c]=g,e[c+1]=y}function h(e,c){return e[c]^e[c+1]<<8^e[c+2]<<16^e[c+3]<<24}function d(e,c,n,p,g,y){const Y=m[g],$=m[g+1],V=m[y],X=m[y+1];r(a,e,c),f(a,e,Y,$);let S=a[p]^a[e],U=a[p+1]^a[e+1];a[p]=U,a[p+1]=S,r(a,n,p),S=a[c]^a[n],U=a[c+1]^a[n+1],a[c]=S>>>24^U<<8,a[c+1]=U>>>24^S<<8,r(a,e,c),f(a,e,V,X),S=a[p]^a[e],U=a[p+1]^a[e+1],a[p]=S>>>16^U<<16,a[p+1]=U>>>16^S<<16,r(a,n,p),S=a[c]^a[n],U=a[c+1]^a[n+1],a[c]=U>>>31^S<<1,a[c+1]=S>>>31^U<<1}const b=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],l=new Uint8Array(s.map(function(e){return e*2})),a=new Uint32Array(32),m=new Uint32Array(32);function k(e,c){let n=0;for(n=0;n<16;n++)a[n]=e.h[n],a[n+16]=b[n];for(a[24]=a[24]^e.t,a[25]=a[25]^e.t/4294967296,c&&(a[28]=~a[28],a[29]=~a[29]),n=0;n<32;n++)m[n]=h(e.b,4*n);for(n=0;n<12;n++)d(0,8,16,24,l[n*16+0],l[n*16+1]),d(2,10,18,26,l[n*16+2],l[n*16+3]),d(4,12,20,28,l[n*16+4],l[n*16+5]),d(6,14,22,30,l[n*16+6],l[n*16+7]),d(0,10,20,30,l[n*16+8],l[n*16+9]),d(2,12,22,24,l[n*16+10],l[n*16+11]),d(4,14,16,26,l[n*16+12],l[n*16+13]),d(6,8,18,28,l[n*16+14],l[n*16+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^a[n]^a[n+16]}const A=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function I(e,c,n,p){if(e===0||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(c&&c.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(n&&n.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(p&&p.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const g={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};A.fill(0),A[0]=e,c&&(A[1]=c.length),A[2]=1,A[3]=1,n&&A.set(n,32),p&&A.set(p,48);for(let y=0;y<16;y++)g.h[y]=b[y]^h(A,y*4);return c&&(E(g,c),g.c=128),g}function E(e,c){for(let n=0;n>2]>>8*(n&3);return c}function o(e,c,n,p,g){n=n||64,e=i.normalizeInput(e),p&&(p=i.normalizeInput(p)),g&&(g=i.normalizeInput(g));const y=I(n,c,p,g);return E(y,e),u(y)}function t(e,c,n,p,g){const y=o(e,c,n,p,g);return i.toHex(y)}return C={blake2b:o,blake2bHex:t,blake2bInit:I,blake2bUpdate:E,blake2bFinal:u},C}var T,D;function ee(){if(D)return T;D=1;const i=L();function r(u,o){return u[o]^u[o+1]<<8^u[o+2]<<16^u[o+3]<<24}function f(u,o,t,e,c,n){s[u]=s[u]+s[o]+c,s[e]=h(s[e]^s[u],16),s[t]=s[t]+s[e],s[o]=h(s[o]^s[t],12),s[u]=s[u]+s[o]+n,s[e]=h(s[e]^s[u],8),s[t]=s[t]+s[e],s[o]=h(s[o]^s[t],7)}function h(u,o){return u>>>o^u<<32-o}const d=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),b=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),s=new Uint32Array(16),l=new Uint32Array(16);function a(u,o){let t=0;for(t=0;t<8;t++)s[t]=u.h[t],s[t+8]=d[t];for(s[12]^=u.t,s[13]^=u.t/4294967296,o&&(s[14]=~s[14]),t=0;t<16;t++)l[t]=r(u.b,4*t);for(t=0;t<10;t++)f(0,4,8,12,l[b[t*16+0]],l[b[t*16+1]]),f(1,5,9,13,l[b[t*16+2]],l[b[t*16+3]]),f(2,6,10,14,l[b[t*16+4]],l[b[t*16+5]]),f(3,7,11,15,l[b[t*16+6]],l[b[t*16+7]]),f(0,5,10,15,l[b[t*16+8]],l[b[t*16+9]]),f(1,6,11,12,l[b[t*16+10]],l[b[t*16+11]]),f(2,7,8,13,l[b[t*16+12]],l[b[t*16+13]]),f(3,4,9,14,l[b[t*16+14]],l[b[t*16+15]]);for(t=0;t<8;t++)u.h[t]^=s[t]^s[t+8]}function m(u,o){if(!(u>0&&u<=32))throw new Error("Incorrect output length, should be in [1, 32]");const t=o?o.length:0;if(o&&!(t>0&&t<=32))throw new Error("Incorrect key length, should be in [1, 32]");const e={h:new Uint32Array(d),b:new Uint8Array(64),c:0,t:0,outlen:u};return e.h[0]^=16842752^t<<8^u,t>0&&(k(e,o),e.c=64),e}function k(u,o){for(let t=0;t>2]>>8*(t&3)&255;return o}function I(u,o,t){t=t||32,u=i.normalizeInput(u);const e=m(t,o);return k(e,u),A(e)}function E(u,o,t){const e=I(u,o,t);return i.toHex(e)}return T={blake2s:I,blake2sHex:E,blake2sInit:m,blake2sUpdate:k,blake2sFinal:A},T}var O,N;function te(){if(N)return O;N=1;const i=Z(),r=ee();return O={blake2b:i.blake2b,blake2bHex:i.blake2bHex,blake2bInit:i.blake2bInit,blake2bUpdate:i.blake2bUpdate,blake2bFinal:i.blake2bFinal,blake2s:r.blake2s,blake2sHex:r.blake2sHex,blake2sInit:r.blake2sInit,blake2sUpdate:r.blake2sUpdate,blake2sFinal:r.blake2sFinal},O}var M=te();const q=x({bits:24,rounds:23,rightRotations:8,leftRotations:3});function H(i){const r=M.blake2bHex(i,null,12);return[parseInt(r.slice(0,6),16),parseInt(r.slice(6,12),16),parseInt(r.slice(12,18),16),parseInt(r.slice(18,24),16)]}function ne(i){return q.encrypt(0,i)&16777215}function K(i,r){const h=ne(i)*16777216+(r&16777215);return q.encrypt(h,i)}function re(i,r){return Array.from(i,(f,h)=>{const d=K(r,h);return(f.codePointAt(0)^d)>>>0})}function oe(i,r){return i.map((f,h)=>{const d=K(r,h),b=(f^d)>>>0;try{return String.fromCodePoint(b)}catch{return""}}).join("")}const G=x();function v(i){const r=M.blake2bHex(i,null,8);return[parseInt(r.slice(0,4),16),parseInt(r.slice(4,8),16),parseInt(r.slice(8,12),16),parseInt(r.slice(12,16),16)]}function ie(i,r){return Array.from(i,f=>G.encrypt(f.codePointAt(0),r))}function ce(i,r){return i.map(f=>{try{return String.fromCodePoint(G.decrypt(f,r))}catch{return""}}).join("")}const B=document.getElementById("textarea"),se=document.getElementById("encoder"),le=document.getElementById("cipher");document.getElementById("encodeButton").addEventListener("click",z);document.getElementById("decodeButton").addEventListener("click",z);function z(i){if(B.value===""){B.value="The text box is empty.";return}const r=i.target.id==="encodeButton"?"NO":"YES",f=ue(),h=se.value.split("-")[1],d=f!=="PLAIN",b=d&&prompt("enter password.");if(!(d&&!b)){try{B.value=ae[r][f](B.value,h,b)}catch(s){console.log(s)}r==="NO"&&(B.select(),document.execCommand("copy"),B.value=`Copied to your clipboard. + A copy has been placed between these brackets [`+B.value+"]")}}function ue(){return le.value}const ae={NO:{PLAIN:(i,r)=>w.encodeString(i,r),SPECK48_96CTR:(i,r,f)=>w.encodeNumberArray(re(i,H(f)),r),"SPECK32_64ECB (insecure)":(i,r,f)=>w.encodeNumberArray(ie(i,v(f)),r)},YES:{PLAIN:(i,r)=>w.decodeToString(i,r),SPECK48_96CTR:(i,r,f)=>oe(w.decodeToNumberArray(i,r),H(f)),"SPECK32_64ECB (insecure)":(i,r,f)=>ce(w.decodeToNumberArray(i,r),v(f))}}; diff --git a/dist/web/assets/index-cTpPMjvG.js b/dist/web/assets/index-cTpPMjvG.js deleted file mode 100644 index ed90da8..0000000 --- a/dist/web/assets/index-cTpPMjvG.js +++ /dev/null @@ -1,4 +0,0 @@ -(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))b(f);new MutationObserver(f=>{for(const p of f)if(p.type==="childList")for(const c of p.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&b(c)}).observe(document,{childList:!0,subtree:!0});function d(f){const p={};return f.integrity&&(p.integrity=f.integrity),f.referrerPolicy&&(p.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?p.credentials="include":f.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function b(f){if(f.ep)return;f.ep=!0;const p=d(f);fetch(f.href,p)}})();const I={3:{unifier:"­",0:"᠎",1:"​",2:"‍"},6:{unifier:"‌",0:"‍",1:"‏",2:"­",3:"⁠",4:"​",5:"‎"},8:{unifier:"‌",0:"‍",1:"‏",2:"­",3:"⁠",4:"​",5:"‎",6:"᠎",7:"\uFEFF"},encodeString:(u,r=3)=>Array.from(u,d=>d.codePointAt(0).toString(r).split("").map(b=>I[r][b]).join("")).join(I[r].unifier),encodeNumberArray:(u,r=3)=>u.map(d=>d.toString(r).split("").map(b=>I[r][b]).join("")).join(I[r].unifier),decodeToString:(u,r=3)=>u.split(I[r].unifier).map(d=>String.fromCodePoint(parseInt(Array.from(d).map(b=>Object.keys(I[r]).find(f=>I[r][f]===b)).join(""),r))).join(""),decodeToNumberArray:(u,r=3)=>u.split(I[r].unifier).map(d=>parseInt(Array.from(d).map(b=>Object.keys(I[r]).find(f=>I[r][f]===b)).join(""),r))};function Y(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var T,_;function x(){if(_)return T;_=1;const u="Input must be an string, Buffer or Uint8Array";function r(c){let s;if(c instanceof Uint8Array)s=c;else if(typeof c=="string")s=new TextEncoder().encode(c);else throw new Error(u);return s}function d(c){return Array.prototype.map.call(c,function(s){return(s<16?"0":"")+s.toString(16)}).join("")}function b(c){return(4294967296+c).toString(16).substring(1)}function f(c,s,a){let g=` -`+c+" = ";for(let k=0;k=4294967296&&m++,e[i]=h,e[i+1]=m}function d(e,i,n,h){let m=e[i]+n;n<0&&(m+=4294967296);let y=e[i+1]+h;m>=4294967296&&y++,e[i]=m,e[i+1]=y}function b(e,i){return e[i]^e[i+1]<<8^e[i+2]<<16^e[i+3]<<24}function f(e,i,n,h,m,y){const q=g[m],G=g[m+1],K=g[y],z=g[y+1];r(a,e,i),d(a,e,q,G);let S=a[h]^a[e],U=a[h+1]^a[e+1];a[h]=U,a[h+1]=S,r(a,n,h),S=a[i]^a[n],U=a[i+1]^a[n+1],a[i]=S>>>24^U<<8,a[i+1]=U>>>24^S<<8,r(a,e,i),d(a,e,K,z),S=a[h]^a[e],U=a[h+1]^a[e+1],a[h]=S>>>16^U<<16,a[h+1]=U>>>16^S<<16,r(a,n,h),S=a[i]^a[n],U=a[i+1]^a[n+1],a[i]=U>>>31^S<<1,a[i+1]=S>>>31^U<<1}const p=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),c=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],s=new Uint8Array(c.map(function(e){return e*2})),a=new Uint32Array(32),g=new Uint32Array(32);function k(e,i){let n=0;for(n=0;n<16;n++)a[n]=e.h[n],a[n+16]=p[n];for(a[24]=a[24]^e.t,a[25]=a[25]^e.t/4294967296,i&&(a[28]=~a[28],a[29]=~a[29]),n=0;n<32;n++)g[n]=b(e.b,4*n);for(n=0;n<12;n++)f(0,8,16,24,s[n*16+0],s[n*16+1]),f(2,10,18,26,s[n*16+2],s[n*16+3]),f(4,12,20,28,s[n*16+4],s[n*16+5]),f(6,14,22,30,s[n*16+6],s[n*16+7]),f(0,10,20,30,s[n*16+8],s[n*16+9]),f(2,12,22,24,s[n*16+10],s[n*16+11]),f(4,14,16,26,s[n*16+12],s[n*16+13]),f(6,8,18,28,s[n*16+14],s[n*16+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^a[n]^a[n+16]}const A=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function w(e,i,n,h){if(e===0||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(i&&i.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(n&&n.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(h&&h.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const m={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};A.fill(0),A[0]=e,i&&(A[1]=i.length),A[2]=1,A[3]=1,n&&A.set(n,32),h&&A.set(h,48);for(let y=0;y<16;y++)m.h[y]=p[y]^b(A,y*4);return i&&(E(m,i),m.c=128),m}function E(e,i){for(let n=0;n>2]>>8*(n&3);return i}function o(e,i,n,h,m){n=n||64,e=u.normalizeInput(e),h&&(h=u.normalizeInput(h)),m&&(m=u.normalizeInput(m));const y=w(n,i,h,m);return E(y,e),l(y)}function t(e,i,n,h,m){const y=o(e,i,n,h,m);return u.toHex(y)}return F={blake2b:o,blake2bHex:t,blake2bInit:w,blake2bUpdate:E,blake2bFinal:l},F}var O,N;function X(){if(N)return O;N=1;const u=x();function r(l,o){return l[o]^l[o+1]<<8^l[o+2]<<16^l[o+3]<<24}function d(l,o,t,e,i,n){c[l]=c[l]+c[o]+i,c[e]=b(c[e]^c[l],16),c[t]=c[t]+c[e],c[o]=b(c[o]^c[t],12),c[l]=c[l]+c[o]+n,c[e]=b(c[e]^c[l],8),c[t]=c[t]+c[e],c[o]=b(c[o]^c[t],7)}function b(l,o){return l>>>o^l<<32-o}const f=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),p=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),c=new Uint32Array(16),s=new Uint32Array(16);function a(l,o){let t=0;for(t=0;t<8;t++)c[t]=l.h[t],c[t+8]=f[t];for(c[12]^=l.t,c[13]^=l.t/4294967296,o&&(c[14]=~c[14]),t=0;t<16;t++)s[t]=r(l.b,4*t);for(t=0;t<10;t++)d(0,4,8,12,s[p[t*16+0]],s[p[t*16+1]]),d(1,5,9,13,s[p[t*16+2]],s[p[t*16+3]]),d(2,6,10,14,s[p[t*16+4]],s[p[t*16+5]]),d(3,7,11,15,s[p[t*16+6]],s[p[t*16+7]]),d(0,5,10,15,s[p[t*16+8]],s[p[t*16+9]]),d(1,6,11,12,s[p[t*16+10]],s[p[t*16+11]]),d(2,7,8,13,s[p[t*16+12]],s[p[t*16+13]]),d(3,4,9,14,s[p[t*16+14]],s[p[t*16+15]]);for(t=0;t<8;t++)l.h[t]^=c[t]^c[t+8]}function g(l,o){if(!(l>0&&l<=32))throw new Error("Incorrect output length, should be in [1, 32]");const t=o?o.length:0;if(o&&!(t>0&&t<=32))throw new Error("Incorrect key length, should be in [1, 32]");const e={h:new Uint32Array(f),b:new Uint8Array(64),c:0,t:0,outlen:l};return e.h[0]^=16842752^t<<8^l,t>0&&(k(e,o),e.c=64),e}function k(l,o){for(let t=0;t>2]>>8*(t&3)&255;return o}function w(l,o,t){t=t||32,l=u.normalizeInput(l);const e=g(t,o);return k(e,l),A(e)}function E(l,o,t){const e=w(l,o,t);return u.toHex(e)}return O={blake2s:w,blake2sHex:E,blake2sInit:g,blake2sUpdate:k,blake2sFinal:A},O}var j,v;function J(){if(v)return j;v=1;const u=V(),r=X();return j={blake2b:u.blake2b,blake2bHex:u.blake2bHex,blake2bInit:u.blake2bInit,blake2bUpdate:u.blake2bUpdate,blake2bFinal:u.blake2bFinal,blake2s:r.blake2s,blake2sHex:r.blake2sHex,blake2sInit:r.blake2sInit,blake2sUpdate:r.blake2sUpdate,blake2sFinal:r.blake2sFinal},j}var Q=J(),P,H;function W(){if(H)return P;H=1;function u(r={}){const d=r.bits||16,b=r.rounds||22,f=r.rightRotations||7,p=r.leftRotations||2,c=2**d,s=c-1,a=(o,t)=>o>>t|o<o<>d-t,k=(o,t,e)=>(o=a(o,f),o=o+t&s,o^=e,t=g(t,p),t^=o,[o,t]),A=(o,t,e)=>(t^=o,t=a(t,p),o^=e,o=o-t&s,o=g(o,f),[o,t]);function w(o,t){let e=o[0],i=o[1],n=t[0],h=t.slice(1);[i,e]=k(i,e,n);for(let m=0;m{const i=o([t/c|0,t&s],e);return i[0]*c+i[1]}}return{encrypt:l(w),decrypt:l(E),encryptRaw:w,decryptRaw:E}}return P=u,P}var Z=W();const $=Y(Z),C=$(),B=document.getElementById("textarea"),ee=document.getElementById("encoder"),te=document.getElementById("cipher");document.getElementById("encodeButton").addEventListener("click",M);document.getElementById("decodeButton").addEventListener("click",M);function R(u){const r=Q.blake2bHex(u,null,8);return[parseInt(r.slice(0,4),16),parseInt(r.slice(4,8),16),parseInt(r.slice(8,12),16),parseInt(r.slice(12,16),16)]}function ne(u){return C.encrypt(0,u)&65535}function L(u,r){const b=(ne(u)<<16|r&65535)>>>0;return C.encrypt(b,u)>>>0}function re(u,r){return Array.from(u,(d,b)=>{const f=L(r,b);return(d.codePointAt(0)^f)>>>0})}function oe(u,r){return u.map((d,b)=>{const f=L(r,b),p=(d^f)>>>0;try{return String.fromCodePoint(p)}catch{return""}}).join("")}function ie(){return te.value}function M(u){if(B.value===""){B.value="The text box is empty.";return}const r=u.target.id==="encodeButton"?"NO":"YES",d=ie(),b=ee.value.split("-")[1],f=d!=="PLAIN",p=f&&prompt("enter password.");if(!(f&&!p)){try{B.value=ce[r][d](B.value,b,p)}catch(c){console.log(c)}r==="NO"&&(B.select(),document.execCommand("copy"),B.value=`Copied to your clipboard. - A copy has been placed between these brackets [`+B.value+"]")}}const ce={NO:{PLAIN:(u,r)=>I.encodeString(u,r),SPECK32_64CTR:(u,r,d)=>I.encodeNumberArray(re(u,R(d)),r),"SPECK32_64ECB (insecure)":(u,r,d)=>{const b=R(d);return I.encodeNumberArray(Array.from(u,f=>C.encrypt(f.codePointAt(0),b)),r)}},YES:{PLAIN:(u,r)=>I.decodeToString(u,r),SPECK32_64CTR:(u,r,d)=>oe(I.decodeToNumberArray(u,r),R(d)),"SPECK32_64ECB (insecure)":(u,r,d)=>{const b=R(d);return I.decodeToNumberArray(u,r).map(f=>{try{return String.fromCodePoint(C.decrypt(f,b))}catch{return""}}).join("")}}}; diff --git a/dist/web/index.html b/dist/web/index.html index 72406f3..f23e73b 100644 --- a/dist/web/index.html +++ b/dist/web/index.html @@ -3,11 +3,11 @@ - + -

inØsight 2.2.0source

+

inØsight 2.3.0source

@@ -21,7 +21,7 @@