# HMAC generator

Compute an HMAC signature of a message with a secret key, as hex or base64.

- Endpoint: `POST https://setget.net/v1/tools/hmac` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `hmac`
- Page: https://setget.net/tools/hmac

## Inputs

- `message` (required, string): The message to sign.
- `key` (required, string): The secret key. Use a test key here, never a production secret.
- `algorithm` (optional, string, one of `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha3-256`, `blake2b`, default `"sha256"`): The hash function to use.
- `key_encoding` (optional, string, one of `text`, `hex`, `base64`, default `"text"`): How the key is written: plain text (UTF-8), hex digits or base64.
- `output` (optional, string, one of `hex`, `base64`, default `"hex"`): How to write the result.

## Example 1

```json
{"input":{"message":"what do ya want for nothing?","key":"Jefe"}}
```

Result:

```json
{"text":"5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843","algorithm":"sha256","bits":256}
```

## Example 2: A hex key with SHA-1

```json
{"input":{"message":"The quick brown fox jumps over the lazy dog","key":"6b6579","key_encoding":"hex","algorithm":"sha1"}}
```

Result:

```json
{"text":"de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9","algorithm":"sha1","bits":160}
```

**Is it safe to enter my real secret key?** No. Never send a production secret to any online tool. Nothing is stored here, but a real key should stay on your own systems. Test with a throwaway key.

**Why does my webhook signature not match?** Sign the raw request body exactly as received, byte for byte. Re-formatted JSON, a different line ending or a key given as text when it is really hex will all change the result.

**Is HMAC with MD5 or SHA-1 broken?** HMAC holds up better than the plain hashes, but new systems should use SHA-256 or stronger.
