method = $method; $this->key = $key; $this->iv = $iv; } // 加密 public function aesEn($data){ return base64_encode(openssl_encrypt($data, $this->method,$this->key, OPENSSL_RAW_DATA , $this->iv)); } //解密 public function aesDe($data){ return openssl_decrypt(base64_decode($data), $this->method, $this->key, OPENSSL_RAW_DATA, $this->iv); } }