You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
1.6 KiB
1 lines
1.6 KiB
!function(r){var n={};function i(t){if(n[t])return n[t].exports;var e=n[t]={exports:{},id:t,loaded:!1};return r[t].call(e.exports,e,e.exports,i),e.loaded=!0,e.exports}i.m=r,i.c=n,i.p="",i(0)}([function(t,e,r){t.exports=r(1)},function(t,e){"use strict";function r(t){return a.test(t)&&t.length<=15}var n={bits:1024,thisKeyPair:null,getKeyPair:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:n.bits,e={};return n.thisKeyPair=new JSEncrypt({default_key_size:t}),e.privateKey=n.thisKeyPair.getPrivateKey(),e.publicKey=n.thisKeyPair.getPublicKey(),e},encrypt:function(t,e){return t instanceof Object&&(t=JSON.stringify(t)),n.thisKeyPair.setPublicKey(e),n.thisKeyPair.encrypt(t)},decrypt:function(t,e){n.thisKeyPair.setPrivateKey(e);t=n.thisKeyPair.decrypt(t);return t="{"===t.charAt(0)||"["===t.charAt(0)?JSON.parse(t):t}},i={getKey:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:16,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="",n=0;n<t;n++)r+=e.charAt(Math.random()*e.length);return r},encrypt:function(t,e){return t instanceof Object&&(t=JSON.stringify(t)),CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(t),CryptoJS.enc.Utf8.parse(e),{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7}).toString()},decrypt:function(t,e){e=CryptoJS.AES.decrypt(t,CryptoJS.enc.Utf8.parse(e),{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7}),e=CryptoJS.enc.Utf8.stringify(e).toString();return e="{"===e.charAt(0)||"["===e.charAt(0)?JSON.parse(e):e}},a=/^\S*(?=\S{8,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*?])\S*$/;window.createIS=function(){return{rsaUtil:n,aesUtil:i,pwdReg:a,verifyPwd:r}}}]);
|