encode before hmac