CryptoJS aes加密

CryptoJS aes加密

导入:aes.js

!function(t,n){
   "object"==typeof exports?module.exports=exports=n():"function"==typeof define&&define.amd?define([],n):t.CryptoJS=n()}(this,function(){
   var t=t||function(t,n){
   var i=Object.create||function(){
   function t(){
   }return function(n){
   var i;return t.prototype=n,i=new t,t.prototype=null,i}}(),e={
   },r=e.lib={
   },o=r.Base=function(){
   return{
   extend:function(t){
   var n=i(this);return t&&n.mixIn(t),n.hasOwnProperty("init")&&this.init!==n.init||(n.init=function(){
   n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){
   var t=this.extend();return t.init.apply(t,arguments),t},init:function(){
   },mixIn:function(t){
   for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){
   return this.init.prototype.extend(this)}}}(),s=r.WordArray=o.extend({
   init:function(t,i){
   t=this.words=t||[],i!=n?this.sigBytes=i:this.sigBytes=4*t.length},toString:function(t){
   return(t||c).stringify(this)},concat:function(t){
   var n=this.words,i=t.words,e=this.sigBytes,r=t.sigBytes;if(this.clamp(),e%4)for(var o=0;o<r;o++){
   var s=i[o>>>2]>>>24-o%4*8&255;n[e+o>>>2]|=s<<24-(e+o)%4*8}else for(var o=0;o<r;o+=4)n[e+o>>>2]=i[o>>>2];return this.sigBytes+=r,this},clamp:function(){
   var n=this.words,i=this.sigBytes;n[i>>>2]&=4294967295<<32-i%4*8,n.length=t.ceil(i/4)},clone:function(){
   var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(n){
   for(var i,e=[],r=function(n){
   var n=n,i=987654321,e=4294967295;return function(){
   i=36969*(65535&i)+(i>>16)&e,n=18e3*(65535&n)+(n>>16)&e;var r=(i<<16)+n&e;return r/=4294967296,r+=.5,r*(t.random()>.5?1:-1)}},o=0;o<n;o+=4){
   var a=r(4294967296*(i||t.random()));i=987654071*a(),e.push(4294967296*a()|0)}return new s.init(e,n)}}),a=e.enc={
   },c=a.Hex={
   stringify:function(t){
   for(var n=t.words,i=t.sigBytes,e=[],r=0;r<i;r++){
   var o=n[r>>>2]>>>24-r%4*8&255;e.push((o>>>4).toString(16)),e.push((15&o).toString(16))}return e.join("")},parse:function(t){
   for(var n=t.length,i=[],e=0;e<n;e+=2)i[e>>>3]|=parseInt(t.substr(e,2),16)<<24-e%8*4;return new s.init(i,n/2)}},u=a.Latin1={
   stringify:function(t){
   for(var n=t.words,i=t.sigBytes,e=[],r=0;r<i;r++){
   var o=n[r>>>2]>>>24-r%4*8&255;e.push(String.fromCharCode(o))}return e.join("")},parse:function(t){
   for(var n=t.length,i=[],e=0;e<n;e++)i[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8;return new s.init(i,n)}},f=a.Utf8={
   stringify:function(t){
   try{
   return decodeURIComponent(escape(u.stringify(t)))}catch(t){
   throw new Error("Malformed UTF-8 data")}},parse:function(t){
   return u.parse(unescape(encodeURIComponent(t)))}},h=r.BufferedBlockAlgorithm=o.extend({
   reset:function(){
   this._data=new s.init,this._nDataBytes=0},_append:function(t){
   "string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(n){
   var i=this._data,e=i.words
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值