优美短文

php7 AES IOS Android

$key = 'SK7381DNSU#&#@DS';  //key的长度保持16位 加粗 标识
$cipher = "AES-128-ECB";
$iv_len = openssl_cipher_iv_length($cipher);
$iv = openssl_random_pseudo_bytes($iv_len);
$encrypt_data = openssl_encrypt(json_encode($response), $cipher, $key, $options = 0, $iv, $tag); //加密后自带base64_encode 切勿重复encode

 

posted @ 2018-08-20 19:47  一根PHP  阅读(449)  评论(0编辑  收藏  举报