93 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, |
93 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, |
94 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, |
94 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, |
95 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, |
95 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, |
96 125 ); |
96 125 ); |
97 |
97 |
98 function AESCrypt($ks = 128, $bs = 128, $debug = false) |
|
99 { |
|
100 $this->__construct($ks, $bs, $debug); |
|
101 } |
|
102 |
|
103 function __construct($ks = 128, $bs = 128, $debug = false) |
98 function __construct($ks = 128, $bs = 128, $debug = false) |
104 { |
99 { |
105 $this->keySizeInBits = $ks; |
100 $this->keySizeInBits = $ks; |
106 $this->blockSizeInBits = $bs; |
101 $this->blockSizeInBits = $bs; |
107 |
102 |
1060 $z = $v[$n] = $this->int32($v[$n] + $mx); |
1055 $z = $v[$n] = $this->int32($v[$n] + $mx); |
1061 } |
1056 } |
1062 return $this->long2str($v, false); |
1057 return $this->long2str($v, false); |
1063 } |
1058 } |
1064 |
1059 |
1065 function decrypt($str, $key) { |
1060 function decrypt($str, $key, $encoding = ENC_HEX) { |
1066 if ($str == "") { |
1061 if ($str == "") { |
1067 return ""; |
1062 return ""; |
1068 } |
1063 } |
1069 $v = $this->str2long($str, false); |
1064 $v = $this->str2long($str, false); |
1070 $k = $this->str2long($key, false); |
1065 $k = $this->str2long($key, false); |