Remix.run Logo
RayanROghabian 12 hours ago

This code produces deterministic HMAC-SHA256 digests with domain separation (b"commitment:v1") using only the Python standard library. It allows:

• Sealing a message with a secret key using hmac.new()

• Verifying a message/key/commitment triplet with hmac.compare_digest()

• Randomized key generation via os.urandom(32)

It outputs a verifiable commitment that can later be checked against the original message and key. No third-party libraries or infrastructure required.