久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      PHP7如何實現(xiàn)AES/ECB/PKCS5Padding加密

      本篇文章給大家介紹一下PHP7實現(xiàn)AES/ECB/PKCS5Padding加密的方法。有一定的參考價值,有需要的朋友可以參考一下,希望對大家有所幫助。

      PHP7如何實現(xiàn)AES/ECB/PKCS5Padding加密

      class CryptAES {    /**      * var string $method 加解密方法,可通過openssl_get_cipher_methods()獲得      */     protected $method;      /**      * var string $secret_key 加解密的密鑰      */     protected $secret_key;      /**      * var string $iv 加解密的向量,有些方法需要設置比如CBC      */     protected $iv;      /**      * var string $options (不知道怎么解釋,目前設置為0沒什么問題)      */     protected $options;       /**      * 構造函數(shù)      *      * @param string $key 密鑰      * @param string $method 加密方式      * @param string $iv iv向量      * @param mixed $options 還不是很清楚       *      */     public function __construct($key, $method = 'AES-128-ECB', $iv = '', $options = 0)     {         // key是必須要設置的         $this->secret_key = isset($key) ? $key : exit('key為必須項');          $this->method = $method;          $this->iv = $iv;          $this->options = $options;     }      /**      * 加密方法,對數(shù)據(jù)進行加密,返回加密后的數(shù)據(jù)      *      * @param string $data 要加密的數(shù)據(jù)      *       * @return string       *      */     public function encrypt($data)     {         return openssl_encrypt($data, $this->method, $this->secret_key, $this->options, $this->iv);     }      /**      * 解密方法,對數(shù)據(jù)進行解密,返回解密后的數(shù)據(jù)      *      * @param string $data 要解密的數(shù)據(jù)      *       * @return string       *      */     public function decrypt($data)     {         return openssl_decrypt($data, $this->method, $this->secret_key, $this->options, $this->iv);     } }

      推薦學習:php視頻教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號