var __g__ ={};

!function(t,e){"object"==typeof exports?module.exports=exports=e():"function"==typeof define&&define.amd?define([],e):t.KeyouCryptography=e()}(__g__,function(){function t(e,i,r){if(!(this instanceof t))return new t(e,i,r);null!=e&&("number"==typeof e?this.fromNumber(e,i,r):null==i&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,i))}function e(t){return k.charAt(t)}function i(t,e){var i=U[t.charCodeAt(e)];return null==i?-1:i}function r(e){var i=new t;return i.fromInt(e),i}function n(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function s(t){this.m=t}function o(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function f(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function l(){}function p(t){return t}function g(e){this.r2=new t,this.q3=new t,t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function d(){this.i=0,this.j=0,this.S=new Array}function y(){return new d}function m(t){N[P++]^=255&t,N[P++]^=t>>8&255,N[P++]^=t>>16&255,N[P++]^=t>>24&255,P>=O&&(P-=O)}function B(){m((new Date).getTime())}function A(){if(null==M){for(B(),(M=y()).init(N),P=0;P0?this.InitDigest(arguments[0]):this.Init()}var C=C||function(t){var e={};return e.util={},e.algorithm={},e}();C.util.Checker={name:"Checker",checkOnlyPrintChar:function(t){return/^[\u0020-\u007E]+$/.test(t)},checkHasChinese:function(t){return/.*[\u2E80-\u9FFF]+.*$/.test(t)},checkArgument:function(t,e){if(!t)throw new TypeError("Illegal Argument:"+e)},checkExist:function(t,e){if(void 0===typeof t||null===t)throw new TypeError("object is undefined or object is null. "+e);return t},checkNotEmpty:function(t,e){if(void 0===typeof t||null===t)throw new TypeError("object is empty."+e);if(void 0!==typeof t.length&&0===t.length)throw new TypeError("object is empty."+e);return t},checkState:function(t,e){if(!t)throw new Error("Illegal State:"+e)}},function(){var t=C.util,e=t.Checker;t.Hex={name:"Hex",stringify:function(t){for(var e=[],i=t.length,r=0;r>>4).toString(16)),e.push((15&n).toString(16))}return e.join("").toUpperCase()},parse:function(t){var i=[];e.checkArgument(void 0!=t&&t.length%2==0,"illegal Hex string:"+t);var r=new RegExp("[A-Fa-f0-9]+$","g");e.checkArgument(t.match(r),"illegal Hex string:"+t);for(var n=t.length/2,s=0;s>>6&31|192),i.push(63&e|128)):e<65536?(i.push(e>>>12&15|224),i.push(e>>>6&63|128),i.push(63&e|128)):e<2097152&&(i.push(e>>>18&7|240),i.push(e>>>12&63|128),i.push(e>>>6&63|128),i.push(63&e|128));return i}},function(){var t=C.util,e=C.util.Checker;t.Helper=function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)};return{getRandom:function(t){e.checkArgument(t>0,"the random of size must be more than zero.");for(var i,r=new Array(t),n=0;n>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return r/=4294967296,(r+=.5)*(Math.random()>.5?1:-1)}}(4294967296*(i||Math.random()))(),r[n]=255&i;return r},array2ascstr:function(t){for(var i="",r=0,n=t.length;r=32&&t[r]<=126,"contains Non-printable ASCII Character in Array"),i+=String.fromCharCode(t[r]);return i},ascstr2array:function(t){if(0===t.length)return[];e.checkArgument(e.checkOnlyPrintChar(t),"only support printable ASCII character.");for(var i=new Array(t.length),r=0,n=t.length;r>6)+t.charAt(63&r);for(i+1==e.length?(r=parseInt(e.substring(i,i+1),16),n+=t.charAt(r<<2)):i+2==e.length&&(r=parseInt(e.substring(i,i+2),16),n+=t.charAt(r>>2)+t.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n},b64tohex:function(e){var r,n,s="",o=0;for(r=0;r>2),n=3&v,o=1):1==o?(s+=i(n<<2|v>>4),n=15&v,o=2):2==o?(s+=i(n),s+=i(v>>2),n=3&v,o=3):(s+=i(n<<2|v>>4),s+=i(15&v),o=0));return 1==o&&(s+=i(n<<2)),s}}}()}(),C.util.DataPadding={encodeWithNone:function(t,e){return t},decodeWithNone:function(t){return t},encodeWithPKCS5:function(t,e){for(var i=e-t.length%e,r=new Array(t.length+i),n=0;n=0;i--)if(0!=t[i]){e=i+1;break}return t.slice(0,e)},encodeWith0x80:function(t,e){for(var i=e-t.length%e,r=new Array(t.length+i),n=0;n=0;i--)if(0!=t[i]&&128!=t[i]){e=i+1;break}return t.slice(0,e)},encodeWithLV0:function(t,e){},decodeWithLV0:function(t){}};var b=b||function(t,e){var i={},r=i.lib={},n=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var i=new t;return e&&i.mixIn(e),i.hasOwnProperty("init")||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes,n=t.sigBytes;if(this.clamp(),r%4)for(o=0;o>>2]>>>24-o%4*8&255;e[r+o>>>2]|=s<<24-(r+o)%4*8}else if(i.length>65535)for(var o=0;o>>2]=i[o>>>2];else e.push.apply(e,i);return this.sigBytes+=n,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=n.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var i=[],r=0;r>>2]>>>24-n%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new s.init(i,e/2)}},a=o.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],n=0;n>>2]>>>24-n%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new s.init(i,e)}},u=o.Utf8={stringify:function(t){try{return decodeURIComponent(escape(a.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return a.parse(unescape(encodeURIComponent(t)))}},F=r.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var i=this._data,r=i.words,n=i.sigBytes,o=this.blockSize,h=n/(4*o),a=(h=e?t.ceil(h):t.max((0|h)-this._minBufferSize,0))*o,u=t.min(4*a,n);if(a){for(var F=0;F>>2];t.sigBytes-=e}},p=(i.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:l}),reset:function(){u.reset.call(this);var t=this.cfg,e=t.iv,i=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)r=i.createEncryptor;else{var r=i.createDecryptor;this._minBufferSize=1}this._mode=r.call(i,this,e&&e.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),i.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),g=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;if(i)r=n.create([1398893684,1701076831]).concat(i).concat(e);else var r=e;return r.toString(h)},parse:function(t){var e=h.parse(t),i=e.words;if(1398893684==i[0]&&1701076831==i[1]){var r=n.create(i.slice(2,4));i.splice(0,4),e.sigBytes-=16}return p.create({ciphertext:e,salt:r})}},d=i.SerializableCipher=r.extend({cfg:r.extend({format:g}),encrypt:function(t,e,i,r){r=this.cfg.extend(r);var n=t.createEncryptor(i,r),s=n.finalize(e),o=n.cfg;return p.create({ciphertext:s,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,i,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(i,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),v=(e.kdf={}).OpenSSL={execute:function(t,e,i,r){r||(r=n.random(8));var s=a.create({keySize:e+i}).compute(t,r),o=n.create(s.words.slice(e),4*i);return s.sigBytes=4*e,p.create({key:s,iv:o,salt:r})}},y=i.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:v}),encrypt:function(t,e,i,r){var n=(r=this.cfg.extend(r)).kdf.execute(i,t.keySize,t.ivSize);r.iv=n.iv;var s=d.encrypt.call(this,t,e,n.key,r);return s.mixIn(n),s},decrypt:function(t,e,i,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var n=r.kdf.execute(i,t.keySize,t.ivSize,e.salt);return r.iv=n.iv,d.decrypt.call(this,t,e,n.key,r)}})}(),function(){function t(t,e){var i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<>>5]>>>31-r%32&1}for(var n=this._subKeys=[],s=0;s<16;s++){for(var o=n[s]=[],F=u[s],i=0;i<24;i++)o[i/6|0]|=e[(a[i]-1+F)%28]<<31-i%6,o[4+(i/6|0)]|=e[28+(a[i+24]-1+F)%28]<<31-i%6;o[0]=o[0]<<1|o[0]>>>31;for(i=1;i<7;i++)o[i]=o[i]>>>4*(i-1)+3;o[7]=o[7]<<5|o[7]>>>27}for(var c=this._invSubKeys=[],i=0;i<16;i++)c[i]=n[15-i]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(i,r,n){this._lBlock=i[r],this._rBlock=i[r+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;s<16;s++){for(var o=n[s],h=this._lBlock,a=this._rBlock,u=0,f=0;f<8;f++)u|=F[f][((a^o[f])&c[f])>>>0];this._lBlock=a,this._rBlock=h^u}var l=this._lBlock;this._lBlock=this._rBlock,this._rBlock=l,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),i[r]=this._lBlock,i[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});i.DES=s._createHelper(f);var l=o.TripleDES=s.extend({_doReset:function(){var t=this._key.words;this._des1=f.createEncryptor(n.create(t.slice(0,2))),this._des2=f.createEncryptor(n.create(t.slice(2,4))),this._des3=f.createEncryptor(n.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});i.TripleDES=s._createHelper(l)}(),function(){var t=b,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,r=this._map;t.clamp();for(var n=[],s=0;s>>2]>>>24-s%4*8&255)<<16|(e[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|e[s+2>>>2]>>>24-(s+2)%4*8&255,h=0;h<4&&s+.75*h>>6*(3-h)&63));var a=r.charAt(64);if(a)for(;n.length%4;)n.push(a);return n.join("")},parse:function(t){var i=t.length,r=this._map,n=r.charAt(64);if(n){var s=t.indexOf(n);-1!=s&&(i=s)}for(var o=[],h=0,a=0;a>>6-a%4*2;o[h>>>2]|=(u|F)<<24-h%4*8,h++}return e.create(o,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();var R=t.prototype;t.prototype.am=function(t,e,i,r,n,s){for(;--s>=0;){var o=e*this[t++]+i[r]+n;n=Math.floor(o/67108864),i[r++]=67108863&o}return n},t.prototype.DB=26,t.prototype.DM=67108863;var T=t.prototype.DV=1<<26;t.prototype.FV=Math.pow(2,52),t.prototype.F1=26,t.prototype.F2=0;var I,H,k="0123456789abcdefghijklmnopqrstuvwxyz",U=new Array;for(I="0".charCodeAt(0),H=0;H<=9;++H)U[I++]=H;for(I="a".charCodeAt(0),H=10;H<36;++H)U[I++]=H;for(I="A".charCodeAt(0),H=10;H<36;++H)U[I++]=H;s.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},s.prototype.revert=function(t){return t},s.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},s.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},s.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.convert=function(e){var i=new t;return e.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),e.s<0&&i.compareTo(t.ZERO)>0&&this.m.subTo(i,i),i},o.prototype.revert=function(e){var i=new t;return e.copyTo(i),this.reduce(i),i},o.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},o.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},o.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},R.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},R.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t=0;){var u=8==n?255&e[o]:i(e,o);u<0?"-"==e.charAt(o)&&(h=!0):(h=!1,0==a?s[s.t++]=u:a+n>s.DB?(s[s.t-1]|=(u&(1<>s.DB-a):s[s.t-1]|=u<

sm2算法前端处理_Postman接口自动化测试实例用到的完整的SM2前端加密算法代码...相关推荐

  1. python接口自动化测试书籍_干货丨Python接口测试自动化实战及代码示例:含get、post等方法...

    引言:年初参与到一个后台系统开发的项目中,里面涉及了很多接口,我做为项目组测试人员,需要对这些接口进行测试,一开始使用 postman 工具测试,很是方便.但随着接口数量的增加,不光要执行手动点击测试 ...

  2. 基于python的界面自动化测试-基于 Python 的接口自动化测试实例

    1 转换测试数据 1.1将用例数据(红色部分)从excel读取出来,并保存在列表中 测试用例写在excel里面,第一列是编号,第二列到倒数第六列是填写的测试数据, 最后五列分别是用例描述,提交数据,结 ...

  3. python自动化测试-基于 Python 的接口自动化测试实例

    1 转换测试数据 1.1将用例数据(红色部分)从excel读取出来,并保存在列表中 测试用例写在excel里面,第一列是编号,第二列到倒数第六列是填写的测试数据, 最后五列分别是用例描述,提交数据,结 ...

  4. 灵魂三问:什么是接口测试,接口测试怎么玩,接口自动化测试怎么玩?

    前言 最近在找工作,因为是做纯服务端测试的,所以面试过程中面试官难免会问,怎么设计接口测试用例,怎么做接口自动化测试?会象征性的考一下基本功. 下面就接口测试,或者说服务端测试,梳理一下我的思路吧~ ...

  5. 前端请求接口post_接口自动化测试-WEB资讯专栏-DMOZ中文网站分类目录

    为什么UI自动化维护成本更高?因为前端页面变化太快,而且UI自动化比较耗时(比如等待页面元素的加载.添加等待时间.定位元素.操作元素.模拟页面动作这些都需要时间)为什么接口自动化维护成本较低?因为接口 ...

  6. 前端vue后端java,Vue调用后端java接口的实例代码_亦心_前端开发者

    前段时间 做了个学校的春萌项目,其中用到 先上后端接口代码: package controller; import net.sf.json.JSONObject; import util.DBUtil ...

  7. 前端调用后端接口 xhr 只看到一次 实际调用两次_持续演进的接口自动化测试方案...

    点击关注"有赞coder" 获取更多技术干货哦- 作者:Henry 部门:美业测试 前言 接口自动化测试是个老生常谈的话题,基本上每个测试团队都会涉及,市面上大部分文章会从如何设计 ...

  8. 使用openssl的EVP接口使用sm2算法加解密等操作

    OpenSSL 1.1.1版本提供了对国密SM2算法的支持.但是不知为什么这么设计,将sm2.h sm3.h sm4.h这些头文件放在源码的cryto/include/internall目录下,这样导 ...

  9. python+requests接口自动化测试框架实例详解教程(米兔888)

    来源:https://my.oschina.net/u/3041656/blog/820023 源码:https://pan.baidu.com/s/1lgIEToiczTvvjy--p-N20g 提 ...

最新文章

  1. 【Android架构师java原理详解】二;反射原理及动态代理模式
  2. java代码实现python2中aes加密经历
  3. 【TensorFlow】tf.concat的用法
  4. 彩信手机报受代表好评
  5. Socket模型详解
  6. select查询语句执行顺序
  7. mysql数据库进行更新、插入显示中文乱码问题
  8. Android前后端交互细节--Json转化为对象的原理
  9. Ubuntu 16.04创建用户,用户授权,查看用户权限
  10. Ubuntu中网络编程的环境配置
  11. J2SE基础夯实系列之正则表达式Java
  12. Mac Android studio: Gradle Build Running 、 run build 运行卡顿 、 加载慢问题问题(亲测可用)
  13. CENTOS 使用 MUTT发送邮件
  14. C++第三方库管理工具vcpkg使用教程
  15. 安卓智能手机完全装机手册,让安卓拥有无限可能!
  16. UVA 11538 : Chess Queen
  17. AutoVue 21.0.1新版本特性:支持在没有Applets的浏览器中运行
  18. 看大品牌如何玩转小程序
  19. 海报看起来很普通?数字平原概念设计来制作
  20. 机械硬盘计算机管理,机械硬盘怎么分区

热门文章

  1. Docker学习总结(39)——简析容器、无服务器和虚拟机的安全性差异
  2. Spring学习总结(27)——Spring常用注解再总结
  3. Spring Cloud与微服务学习总结(1)——Spring Cloud及微服务入门
  4. 同一个html自动跳转分页,一个页面有多个分页,相互影响
  5. git全局配置用户名和密码_git---全局设置用户名、密码、邮箱
  6. Linux一个cpu有多少个vector,C++中vector容器大小增长规律浅析
  7. jquery ajax 拒绝访问,拒绝访问IE上的jQuery脚本
  8. 访问不上服务器的任何端口
  9. SpringMVC 中整合JSON、XML视图二
  10. 30 秒裁剪的很大一部分作用是观察什么对别人是重要的