EncryptPhoneHandler.php 383 B

1234567891011121314151617181920
  1. <?php
  2. namespace App\Handlers;
  3. use Illuminate\Encryption\Encrypter;
  4. class EncryptPhoneHandler{
  5. public function phone(){
  6. $key = 'your-encryption-key'; // 自定义的加密密钥
  7. $data = 'Hello, World!';
  8. $encrypter = new Encrypter($key, 'AES-256-CBC');
  9. $encryptedData = $encrypter->encryptString($data);
  10. echo $encryptedData;
  11. }
  12. }