You should not use plain MD5; MD5 is not intended to provide message authenticity. Instead, you can simply publish the timestamp along with other information (message) encoded by base64 so that it does not contain the ":" character. Then you can compute the HMAC message code, for example using
$hmac = hash_hmac("md5", $message, $secret) $signed_message = $message . ":" . $hmac
At the other end, you can verify this signature by first splitting the ":", getting $ message and $ hmac, then you can verify authenticity with
$hmac == hash_hmac("md5", $message, $secret)
If the codes match, check to see if the timestamp in $message is kept within.
source share