Is it possible to write these functions in Python?
var hash = CryptoJS.HmacSHA256("Message", "Secret Passphrase");
var v = hash.toString(CryptoJS.enc.Hex)
Thanks in advance.
Yes, using hmac and hashlib from the standard library.
import hashlib
import hmac
message = b"Message"
key = b"Secret Passphrase"
h = hmac.new(key, message, hashlib.sha256)
print(h.hexdigest())
Gives output 32c647602ab4c4c7543e9c50ae25e567c3354e1532b11649ce308e6e2568d205, which is identical to v in answer.