微信小店 回调接口,php 使用openssl_decrypt 解密消息体"Encrypt"密文
微信小店 回调接口,php 使用openssl_decrypt 解密消息体"Encrypt"密文,部分消息成功、部分消息失败是什么原因? 1、【订单支付成功】、【订单取消】、【订单申请退款】是可以正常解密的 2、【订单其他信息更新】解密失败 解密代码如下: //$aeskey 就是EncodingAESKey $encrypted是需要解密的密文
$aeskey = base64_decode( self::$aeskey . "=" );
$iv = substr($aeskey,0,16);
$ciphertext_dec = base64_decode($encrypted);
$decrypted = openssl_decrypt($ciphertext_dec,'AES-256-CBC',$aeskey,1,$iv);