import binascii
import hmac
import hashlib


def sign_message(message: str, key: str) -> str:
    """Signs a message with a key.

    Args:
        message:
            String of the message we want to sign.
        key:
            String of the SHA256 hex encoded key we want to use to sign the message.
    
    Returns:
        A string containing the SHA256 hex encoded signature of the message.
    """

    key_bytes = binascii.unhexlify(key)
    message_bytes = message.encode()
    return hmac.new(key_bytes, message_bytes, hashlib.sha256).hexdigest()