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