在`php`中我们经常要用到加密解密
比如用户注册,输入了密码,我们需要将`密码加密`后,保存到数据库
那么在登录时,我们需要加密验证
在`php`中有哪些加密函数呢?
```
use Illuminate\Support\Facades\Hash;
1 $passwordHash = password_hash('123456', PASSWORD_BCRYPT);
2 $flag = password_verify('123456',$passwordHash);
3 if($flag){
4 echo "ok";
5 }
6 $str5 = \Crypt::encrypt('123456');
7 echo $str5."
";
8 if(\Crypt::decrypt($str5) == "123456"){
9 echo "ok";
10 }else{
11 echo "no";
12 }
13 $str4 = Hash::make('123456');
14 echo $str4;
15 if (Hash::check(123456, $str4)){
16 return "ok";
17 }else {
18 return "no";
19 }
```