Parcourir la source

260428 修改加密機制

OMEGA\lulufj.ho il y a 3 semaines
Parent
révision
2df7743d03
1 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 4
    3
      app/Helpers/PhoneHelper.php

+ 4
- 3
app/Helpers/PhoneHelper.php Voir le fichier

10
         // $iv = random_bytes(16);
10
         // $iv = random_bytes(16);
11
         $iv = "77f*eb51d38[b947";
11
         $iv = "77f*eb51d38[b947";
12
         $encrypted = openssl_encrypt($phone, 'AES-128-CBC', $key, 0, $iv);
12
         $encrypted = openssl_encrypt($phone, 'AES-128-CBC', $key, 0, $iv);
13
-        return base64_encode($iv . '||' . $encrypted);
13
+        return base64_encode($encrypted);
14
     }
14
     }
15
-
15
+    /*
16
     public static function decrypt(string $encrypted): string
16
     public static function decrypt(string $encrypted): string
17
     {
17
     {
18
         $key = config('app.phone_encrypt_key');
18
         $key = config('app.phone_encrypt_key');
19
         [$iv, $data] = explode('||', base64_decode($encrypted));
19
         [$iv, $data] = explode('||', base64_decode($encrypted));
20
         return openssl_decrypt($data, 'AES-128-CBC', $key, 0, $iv);
20
         return openssl_decrypt($data, 'AES-128-CBC', $key, 0, $iv);
21
-    }
21
+    }*/
22
+
22
 }
23
 }