1234567891011121314151617181920 |
- <?php
- namespace App\Handlers;
- use Illuminate\Encryption\Encrypter;
- class EncryptPhoneHandler{
- public function phone(){
- $key = 'your-encryption-key'; // 自定义的加密密钥
- $data = 'Hello, World!';
- $encrypter = new Encrypter($key, 'AES-256-CBC');
- $encryptedData = $encrypter->encryptString($data);
- echo $encryptedData;
- }
- }
|