php-AES/ECB/PKCS7Padding加密的实现(微信)

加密

$data='加密数据';
$encrypted=base64_encode($data);
$key=md5($key);
 $res=openssl_encrypt($encrypted, 'aes-256-ecb',$key,1,substr( 0, 16));

解密

$encrypted=base64_decode( $res);
$key=md5($key);
 $res=openssl_decrypt($encrypted, 'aes-256-ecb',$key,1,substr( 0, 16));

你可能感兴趣的:(php-AES/ECB/PKCS7Padding加密的实现(微信))