美文网首页
php aes加解密

php aes加解密

作者: 博楠同学 | 来源:发表于2019-04-09 16:24 被阅读0次

    <?php/** * AES 的ECB 加解密 */

    $a = [ 'company'=>'nsfocus', 'time'=>1518316334];
    $a = http_build_query($a);
    echo "<br>";
    $encrypt = openssl_encrypt($a,'AES-128-ECB',"1234567812345678");
    echo $encrypt;echo "<br>";
    $encrypted = base64_decode($encrypt);//
    $encrypted="Pq+ePEU0GTBKCFep5OIRXGYTNVZt8y7wR8S1t1nguCLzDGnE+UXmVOvUs4ixyPeQ";
    echo openssl_decrypt($encrypted,'AES-128-ECB',"1234567812345678",OPENSSL_RAW_DATA); // 解密
    

    相关文章

      网友评论

          本文标题:php aes加解密

          本文链接:https://www.haomeiwen.com/subject/zxhiiqtx.html