php aes加解密
程序员文章站
2024-03-14 17:27:34
...
<?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); // 解密
转载于:https://www.jianshu.com/p/4bd4ec957626
上一篇: echarts使用,Java后台传数据,前台数据展示
下一篇: RSA加解密(JAVA)