1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
var CryptoJS=CryptoJS||function(e,t){var n={},r=n.lib={},i=function(){},s=r.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=r.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;e=e.sigBytes,this.clamp();if(r%4)for(var i=0;i<e;i++)t[r+i>>>2]|=(n[i>>>2]>>>24-8*(i%4)&255)<<24-8*((r+i)%4);else if(65535<n.length)for(i=0;i<e;i+=4)t[r+i>>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-8*(n%4),t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(4294967296*e.random()|0);return new o.init(n,t)}}),u=n.enc={},a=u.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++){var i=t[r>>>2]>>>24-8*(r%4)&255;n.push((i>>>4).toString(16)),n.push((i&15).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-4*(r%8);return new o.init(n,t/2)}},f=u.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++)n.push(String.fromCharCode(t[r>>>2]>>>24-8*(r%4)&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-8*(r%4);return new o.init(n,t)}},l=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},c=r.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,u=i/(4*s),u=t?e.ceil(u):e.max((u|0)-this._minBufferSize,0);t=u*s,i=e.min(4*t,i);if(t){for(var a=0;a<t;a+=s)this._doProcessBlock(r,a);a=r.splice(0,t),n.sigBytes-=i}return new o.init(a,i)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=c.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return(new e.init(n)).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return(new h.HMAC.init(e,n)).finalize(t)}}});var h=n.algo={};return n}(Math);(function(){var e=CryptoJS,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var s=(t[i>>>2]>>>24-8*(i%4)&255)<<16|(t[i+1>>>2]>>>24-8*((i+1)%4)&255)<<8|t[i+2>>>2]>>>24-8*((i+2)%4)&255,o=0;4>o&&i+.75*o<n;o++)e.push(r.charAt(s>>>6*(3-o)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map,i=r.charAt(64);i&&(i=e.indexOf(i),-1!=i&&(n=i));for(var i=[],s=0,o=0;o<n;o++)if(o%4){var u=r.indexOf(e.charAt(o-1))<<2*(o%4),a=r.indexOf(e.charAt(o))>>>6-2*(o%4);i[s>>>2]|=(u|a)<<24-8*(s%4),s++}return t.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(),function(e){function t(e,t,n,r,i,s,o){return e=e+(t&n|~t&r)+i+o,(e<<s|e>>>32-s)+t}function n(e,t,n,r,i,s,o){return e=e+(t&r|n&~r)+i+o,(e<<s|e>>>32-s)+t}function r(e,t,n,r,i,s,o){return e=e+(t^n^r)+i+o,(e<<s|e>>>32-s)+t}function i(e,t,n,r,i,s,o){return e=e+(n^(t|~r))+i+o,(e<<s|e>>>32-s)+t}for(var s=CryptoJS,o=s.lib,u=o.WordArray,a=o.Hasher,o=s.algo,f=[],l=0;64>l;l++)f[l]=4294967296*e.abs(e.sin(l+1))|0;o=o.MD5=a.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,s){for(var o=0;16>o;o++){var u=s+o,a=e[u];e[u]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}var o=this._hash.words,u=e[s+0],a=e[s+1],l=e[s+2],c=e[s+3],h=e[s+4],p=e[s+5],d=e[s+6],v=e[s+7],m=e[s+8],g=e[s+9],y=e[s+10],b=e[s+11],w=e[s+12],E=e[s+13],S=e[s+14],x=e[s+15],T=o[0],N=o[1],C=o[2],k=o[3],T=t(T,N,C,k,u,7,f[0]),k=t(k,T,N,C,a,12,f[1]),C=t(C,k,T,N,l,17,f[2]),N=t(N,C,k,T,c,22,f[3]),T=t(T,N,C,k,h,7,f[4]),k=t(k,T,N,C,p,12,f[5]),C=t(C,k,T,N,d,17,f[6]),N=t(N,C,k,T,v,22,f[7]),T=t(T,N,C,k,m,7,f[8]),k=t(k,T,N,C,g,12,f[9]),C=t(C,k,T,N,y,17,f[10]),N=t(N,C,k,T,b,22,f[11]),T=t(T,N,C,k,w,7,f[12]),k=t(k,T,N,C,E,12,f[13]),C=t(C,k,T,N,S,17,f[14]),N=t(N,C,k,T,x,22,f[15]),T=n(T,N,C,k,a,5,f[16]),k=n(k,T,N,C,d,9,f[17]),C=n(C,k,T,N,b,14,f[18]),N=n(N,C,k,T,u,20,f[19]),T=n(T,N,C,k,p,5,f[20]),k=n(k,T,N,C,y,9,f[21]),C=n(C,k,T,N,x,14,f[22]),N=n(N,C,k,T,h,20,f[23]),T=n(T,N,C,k,g,5,f[24]),k=n(k,T,N,C,S,9,f[25]),C=n(C,k,T,N,c,14,f[26]),N=n(N,C,k,T,m,20,f[27]),T=n(T,N,C,k,E,5,f[28]),k=n(k,T,N,C,l,9,f[29]),C=n(C,k,T,N,v,14,f[30]),N=n(N,C,k,T,w,20,f[31]),T=r(T,N,C,k,p,4,f[32]),k=r(k,T,N,C,m,11,f[33]),C=r(C,k,T,N,b,16,f[34]),N=r(N,C,k,T,S,23,f[35]),T=r(T,N,C,k,a,4,f[36]),k=r(k,T,N,C,h,11,f[37]),C=r(C,k,T,N,v,16,f[38]),N=r(N,C,k,T,y,23,f[39]),T=r(T,N,C,k,E,4,f[40]),k=r(k,T,N,C,u,11,f[41]),C=r(C,k,T,N,c,16,f[42]),N=r(N,C,k,T,d,23,f[43]),T=r(T,N,C,k,g,4,f[44]),k=r(k,T,N,C,w,11,f[45]),C=r(C,k,T,N,x,16,f[46]),N=r(N,C,k,T,l,23,f[47]),T=i(T,N,C,k,u,6,f[48]),k=i(k,T,N,C,v,10,f[49]),C=i(C,k,T,N,S,15,f[50]),N=i(N,C,k,T,p,21,f[51]),T=i(T,N,C,k,w,6,f[52]),k=i(k,T,N,C,c,10,f[53]),C=i(C,k,T,N,y,15,f[54]),N=i(N,C,k,T,a,21,f[55]),T=i(T,N,C,k,m,6,f[56]),k=i(k,T,N,C,x,10,f[57]),C=i(C,k,T,N,d,15,f[58]),N=i(N,C,k,T,E,21,f[59]),T=i(T,N,C,k,h,6,f[60]),k=i(k,T,N,C,b,10,f[61]),C=i(C,k,T,N,l,15,f[62]),N=i(N,C,k,T,g,21,f[63]);o[0]=o[0]+T|0,o[1]=o[1]+N|0,o[2]=o[2]+C|0,o[3]=o[3]+k|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var s=e.floor(r/4294967296);n[(i+64>>>9<<4)+15]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,n[(i+64>>>9<<4)+14]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,t.sigBytes=4*(n.length+1),this._process(),t=this._hash,n=t.words;for(r=0;4>r;r++)i=n[r],n[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360;return t},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),s.MD5=a._createHelper(o),s.HmacMD5=a._createHmacHelper(o)}(Math),function(){var e=CryptoJS,t=e.lib,n=t.Base,r=t.WordArray,t=e.algo,i=t.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,i=n.hasher.create(),s=r.create(),o=s.words,u=n.keySize,n=n.iterations;o.length<u;){a&&i.update(a);var a=i.update(e).finalize(t);i.reset();for(var f=1;f<n;f++)a=i.finalize(a),i.reset();s.concat(a)}return s.sigBytes=4*u,s}});e.EvpKDF=function(e,t,n){return i.create(n).compute(e,t)}}(),CryptoJS.lib.Cipher||function(e){var t=CryptoJS,n=t.lib,r=n.Base,i=n.WordArray,s=n.BufferedBlockAlgorithm,o=t.enc.Base64,u=t.algo.EvpKDF,a=n.Cipher=s.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,r){return("string"==typeof n?d:p).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?d:p).decrypt(e,t,n,r)}}}});n.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=t.mode={},l=function(t,n,r){var i=this._iv;i?this._iv=e:i=this._prevBlock;for(var s=0;s<r;s++)t[n+s]^=i[s]},c=(n.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();c.Encryptor=c.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;l.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),c.Decryptor=c.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=e.slice(t,t+r);n.decryptBlock(e,t),l.call(this,e,t,r),this._prevBlock=i}}),f=f.CBC=c,c=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,n=n-e.sigBytes%n,r=n<<24|n<<16|n<<8|n,s=[],o=0;o<n;o+=4)s.push(r);n=i.create(s,n),e.concat(n)},unpad:function(e){e.sigBytes-=e.words[e.sigBytes-1>>>2]&255}},n.BlockCipher=a.extend({cfg:a.cfg.extend({mode:f,padding:c}),reset:function(){a.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),f=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return e=e.salt,(e?i.create([1398893684,1701076831]).concat(e).concat(t):t).toString(o)},parse:function(e){e=o.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=i.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return h.create({ciphertext:e,salt:n})}},p=n.SerializableCipher=r.extend({cfg:r.extend({format:f}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,h.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),t=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){return r||(r=i.random(8)),e=u.create({keySize:t+n}).compute(e,r),n=i.create(e.words.slice(t),4*n),e.sigBytes=4*t,h.create({key:e,iv:n,salt:r})}},d=n.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:t}),encrypt:function(e,t,n,r){return r=this.cfg.extend(r),n=r.kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,e=p.encrypt.call(this,e,t,n.key,r),e.mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,p.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=CryptoJS,t=e.lib.BlockCipher,n=e.algo,r=[],i=[],s=[],o=[],u=[],a=[],f=[],l=[],c=[],h=[],p=[],d=0;256>d;d++)p[d]=128>d?d<<1:d<<1^283;for(var v=0,m=0,d=0;256>d;d++){var g=m^m<<1^m<<2^m<<3^m<<4,g=g>>>8^g&255^99;r[v]=g,i[g]=v;var y=p[v],b=p[y],w=p[b],E=257*p[g]^16843008*g;s[v]=E<<24|E>>>8,o[v]=E<<16|E>>>16,u[v]=E<<8|E>>>24,a[v]=E,E=16843009*w^65537*b^257*y^16843008*v,f[g]=E<<24|E>>>8,l[g]=E<<16|E>>>16,c[g]=E<<8|E>>>24,h[g]=E,v?(v=y^p[p[p[w^y]]],m^=p[p[m]]):v=m=1}var S=[0,1,2,4,8,16,32,64,128,27,54],n=n.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],s=0;s<e;s++)if(s<n)i[s]=t[s];else{var o=i[s-1];s%n?6<n&&4==s%n&&(o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[o&255]):(o=o<<8|o>>>24,o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[o&255],o^=S[s/n|0]<<24),i[s]=i[s-n]^o}t=this._invKeySchedule=[];for(n=0;n<e;n++)s=e-n,o=n%4?i[s]:i[s-4],t[n]=4>n||4>=s?o:f[r[o>>>24]]^l[r[o>>>16&255]]^c[r[o>>>8&255]]^h[r[o&255]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,o,u,a,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,f,l,c,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,s,o,u){for(var a=this._nRounds,f=e[t]^n[0],l=e[t+1]^n[1],c=e[t+2]^n[2],h=e[t+3]^n[3],p=4,d=1;d<a;d++)var v=r[f>>>24]^i[l>>>16&255]^s[c>>>8&255]^o[h&255]^n[p++],m=r[l>>>24]^i[c>>>16&255]^s[h>>>8&255]^o[f&255]^n[p++],g=r[c>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[l&255]^n[p++],h=r[h>>>24]^i[f>>>16&255]^s[l>>>8&255]^o[c&255]^n[p++],f=v,l=m,c=g;v=(u[f>>>24]<<24|u[l>>>16&255]<<16|u[c>>>8&255]<<8|u[h&255])^n[p++],m=(u[l>>>24]<<24|u[c>>>16&255]<<16|u[h>>>8&255]<<8|u[f&255])^n[p++],g=(u[c>>>24]<<24|u[h>>>16&255]<<16|u[f>>>8&255]<<8|u[l&255])^n[p++],h=(u[h>>>24]<<24|u[f>>>16&255]<<16|u[l>>>8&255]<<8|u[c&255])^n[p++],e[t]=v,e[t+1]=m,e[t+2]=g,e[t+3]=h},keySize:8});e.AES=t._createHelper(n)}(),module.exports={CryptoJS:CryptoJS}; |