Client: data encryption (json JSON.stringify the object into a string format)
PHP:
/ **
* the AES encryption data
* @param type
Data)
{
// encryption
data, ‘aes-128-cbc’, ‘1234123412ABCDEF’,0,‘ABCDEF1234123412’);
if (!$return_data) {
return false;
}
return $return_data;
}
/**
* AES数据解密
* @param type $data
*/
function aesDecrypt($data)
{
//解密
$return_data = openssl_decrypt( $data, 'aes-128-cbc', '1234123412ABCDEF',0,'ABCDEF1234123412');
if (!$return_data) {
return false;
}
return $return_data;
}