This article brings you the content is about PHP data encryption between the signature Algorithm (code), there is a certain reference value, the need for friends can refer to, I hope to help you.
/** * Signature generation algorithm * @param An associative array of the collection of request parameters for the array $params API call, does not contain the sign parameter * @param string $secret The signed key is the session returned when you get access token secret * @return string returns the parameter signature value * /Private Function getsignature ($params) { $secret = $this->secretkey; $str = "; String to be signed//the parameter is sorted in ascending order of the dictionary order of its parameter name ksort ($params); Iterates through each key/value of the sorted parameter array to foreach ($params as $k + $v) { //for Key/value to generate a key=value-formatted string, and stitching it $str after the string to be signed . = $k. $v; } The signature key is stitched to the last face of the signature string $str. = $secret; Generate a MD5 signature for the signature string using the MD5 algorithm, which is the sign parameter value we want to append return MD5 ($STR); }
which
this->secretkey; It can be a two-program-ready encrypted character.