📄 blowfish.js
字号:
for(var i=0,l=_2b.length-1;i<l;i+=2){ba.push(parseInt(_2b.substr(i,2),16));}break;case dojox.encoding.crypto.outputTypes.Raw:ba=_2b;break;default:ba=dojox.encoding.base64.decode(_2b);break;}iv={};iv.left=ba[0]*_6|ba[1]*_5|ba[2]*_4|ba[3];iv.right=ba[4]*_6|ba[5]*_5|ba[6]*_4|ba[7];};this.encrypt=function(_32,key,ao){var out=dojox.encoding.crypto.outputTypes.Base64;var _36=dojox.encoding.crypto.cipherModes.EBC;if(ao){if(ao.outputType){out=ao.outputType;}if(ao.cipherMode){_36=ao.cipherMode;}}var bx=init(key),_38=8-(_32.length&7);for(var i=0;i<_38;i++){_32+=String.fromCharCode(_38);}var _3a=[],_3b=_32.length>>3,pos=0,o={},_3e=(_36==dojox.encoding.crypto.cipherModes.CBC);var _3f={left:iv.left||null,right:iv.right||null};for(var i=0;i<_3b;i++){o.left=_32.charCodeAt(pos)*_6|_32.charCodeAt(pos+1)*_5|_32.charCodeAt(pos+2)*_4|_32.charCodeAt(pos+3);o.right=_32.charCodeAt(pos+4)*_6|_32.charCodeAt(pos+5)*_5|_32.charCodeAt(pos+6)*_4|_32.charCodeAt(pos+7);if(_3e){o.left=(((o.left>>16)^(_3f.left>>16))<<16)|(((o.left&65535)^(_3f.left&65535))&65535);o.right=(((o.right>>16)^(_3f.right>>16))<<16)|(((o.right&65535)^(_3f.right&65535))&65535);}eb(o,bx);if(_3e){_3f.left=o.left;_3f.right=o.right;}_3a.push((o.left>>24)&255);_3a.push((o.left>>16)&255);_3a.push((o.left>>8)&255);_3a.push(o.left&255);_3a.push((o.right>>24)&255);_3a.push((o.right>>16)&255);_3a.push((o.right>>8)&255);_3a.push(o.right&255);pos+=8;}switch(out){case dojox.encoding.crypto.outputTypes.Hex:return dojo.map(_3a,function(_40){return _40.toString(16);}).join("");case dojox.encoding.crypto.outputTypes.String:return _3a.join("");case dojox.encoding.crypto.outputTypes.Raw:return _3a;default:return dojox.encoding.base64.encode(_3a);}};this.decrypt=function(_41,key,ao){var ip=dojox.encoding.crypto.outputTypes.Base64;var _45=dojox.encoding.crypto.cipherModes.EBC;if(ao){if(ao.outputType){ip=ao.outputType;}if(ao.cipherMode){_45=ao.cipherMode;}}var bx=init(key);var pt=[];var c=null;switch(ip){case dojox.encoding.crypto.outputTypes.Hex:c=[];for(var i=0,l=_41.length-1;i<l;i+=2){c.push(parseInt(_41.substr(i,2),16));}break;case dojox.encoding.crypto.outputTypes.String:c=dojo.map(_41.split(""),function(_4b){return _4b.charCodeAt(0);});break;case dojox.encoding.crypto.outputTypes.Raw:c=_41;break;default:c=dojox.encoding.base64.decode(_41);break;}var _4c=c.length>>3,pos=0,o={},_4f=(_45==dojox.encoding.crypto.cipherModes.CBC);var _50={left:iv.left||null,right:iv.right||null};for(var i=0;i<_4c;i++){o.left=c[pos]*_6|c[pos+1]*_5|c[pos+2]*_4|c[pos+3];o.right=c[pos+4]*_6|c[pos+5]*_5|c[pos+6]*_4|c[pos+7];if(_4f){var _51=o.left;var _52=o.right;}db(o,bx);if(_4f){o.left=(((o.left>>16)^(_50.left>>16))<<16)|(((o.left&65535)^(_50.left&65535))&65535);o.right=(((o.right>>16)^(_50.right>>16))<<16)|(((o.right&65535)^(_50.right&65535))&65535);_50.left=_51;_50.right=_52;}pt.push((o.left>>24)&255);pt.push((o.left>>16)&255);pt.push((o.left>>8)&255);pt.push(o.left&255);pt.push((o.right>>24)&255);pt.push((o.right>>16)&255);pt.push((o.right>>8)&255);pt.push(o.right&255);pos+=8;}if(pt[pt.length-1]==pt[pt.length-2]||pt[pt.length-1]==1){var n=pt[pt.length-1];pt.splice(pt.length-n,n);}return dojo.map(pt,function(_54){return String.fromCharCode(_54);}).join("");};this.setIV("0000000000000000",dojox.encoding.crypto.outputTypes.Hex);}();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -