laravel 自定义key来加密

2020-05-22 18:25:04 阅读:1 编辑
 $str = \Illuminate\Support\Str::random(32);
   $encrypter = new \Illuminate\Encryption\Encrypter($str,"AES-256-CBC");
   $val =  $encrypter->encrypt("hello2");
   print_r($val);
   print_r($encrypter->decrypt($val));