Cryptography Utilities

Generate Hmac

Generates HMAC (Hash-based Message Authentication Code) signatures for verifying data integrity and authenticity. Access via MCP in Cursor or Claude Code, or REST API at `/v1/crypto/hmac`. Supports multiple hash algorithms including SHA-256 and SHA-512. Essential for webhook verification, API authentication, and secure data validation workflows.

API Endpoint

GET /v1/crypto/hmac

Code Examples

curl "https://tinyfn.io/v1/crypto/hmac" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/crypto/hmac', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/crypto/hmac',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's cryptography tools:

{
  "mcpServers": {
    "tinyfn-crypto": {
      "url": "https://tinyfn.io/mcp/crypto",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I generate an HMAC-SHA256 signature for webhook verification?

Pass your secret key, message data, and specify 'sha256' as the algorithm. The tool returns a hex-encoded signature that matches webhook providers like GitHub, Stripe, and PayPal.

What hash algorithms does the HMAC generator support?

Supports SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, MD5, and other standard algorithms. SHA-256 is recommended for most applications due to security and widespread compatibility.

Can I use this tool in MCP-enabled AI agents for API authentication?

Yes, AI agents in Cursor, Windsurf, or Cline can generate HMAC signatures for API requests, verify webhook payloads, or create secure tokens without hallucinating invalid signatures.

What's the difference between HMAC and regular hash functions?

HMAC uses a secret key along with the message, providing authentication and integrity. Regular hashes only provide integrity checking and can't verify the sender's identity.

How do I verify an existing HMAC signature?

Generate a new HMAC using the same key, message, and algorithm, then compare it with the provided signature. Use constant-time comparison to prevent timing attacks.

Try Generate Hmac Now

Get your free API key and start using Generate Hmac in seconds.

Get Free API Key