Improve security of OptInHandler.

Converted MD5 hash to HMAC.