<?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); // 解密
网友评论