implement utilities to compute hmac/xor keys and encrypt response for getSignToken2