UUID Use Case

UUID API Secret

When you sign requests with HMAC, the secret must be high-entropy and secret. A v4 UUID works for low-risk signing; prefer 32+ bytes for serious use.

HMAC secretStore hashedRotatable

Generated locally with the Web Crypto API — nothing leaves your browser.

What Is UUID API Secret?

How to generate

  1. Generate the secret (UUID or os.urandom(32)).
  2. Store a hash; compare signatures, never the secret.
  3. Support rotation by issuing a new secret.

Use Cases

Code Examples

Python
import hmac, hashlib, uuid
secret = str(uuid.uuid4()).encode()
sig = hmac.new(secret, payload, hashlib.sha256).hexdigest()

Frequently Asked Questions

Is a UUID secret strong enough?
For HMAC it is fine at 122 bits, but many standards prefer 32 bytes; size it to your threat model.
Store the secret or a hash?
Store a hash and verify signatures against it; never persist the raw secret if you can avoid it.

Related tools