Skip to main content

Crypto Node

Verifies or creates HMAC signatures, hashes data, Base64-encodes or decodes it, or generates a UUID. Its main job is checking webhook signatures (GitHub, Stripe, Shopify, Slack and similar) before a workflow trusts the request.

Operations​

config.operationWhat it doesBranch outputs
hmac_verify (default)Computes the HMAC of the data and compares it with the received signature in constant time.valid, invalid
hmac_signReturns the HMAC of the data in result.success, error
hashReturns the SHA digest of the data in result.success, error
base64_encodeReturns the data as Base64 in result.success, error
base64_decodeDecodes standard or URL-safe Base64, with or without padding.success, error
uuidReturns a random version 4 UUID in result.success, error

hmac_verify fails closed: a missing or malformed signature, a missing credential or an unknown option all go to invalid with a reason in error.

Config​

  • credentials_id (HMAC only): a credential of type API key. Its key is the HMAC secret (for example the webhook signing secret). The secret is encrypted at rest and never appears in node output, logs or test results.
  • algorithm: sha256 (default), sha512 or sha1 (only for providers that still require it).
  • encoding: hex (default), base64 or base64url. For hmac_verify this is the format of the received signature; hex is case-insensitive and Base64 padding is optional.
  • signature_prefix: for example sha256= (GitHub). On verify it must be present and is removed before comparing; on sign it is added to result.
  • use_raw_body: use the exact request body bytes received by the workflow's http_trigger as data. Turn this on for webhook signatures. Expressions see JSON bodies as parsed objects, and re-encoding them changes spacing and key order, so the signature would not match.
  • url_safe (base64_encode): use the URL-safe alphabet without padding.

Inputs​

  • data: the value to sign, verify, hash or encode. Objects are encoded as compact JSON. Ignored when use_raw_body is on.
  • payload_prefix (optional): text placed directly before the data, for providers that sign timestamp + "." + body (Stripe) or v0:timestamp:body (Slack).
  • signature (hmac_verify): the received signature, usually a request header. Request headers are lists; the first value is used, so headers['X-Hub-Signature-256'] works without [0].

Outputs​

  • matched_output: the branch (see the table above).
  • result: the signature, digest, encoded or decoded text, or UUID. Not set for hmac_verify.
  • error: why the operation failed or the signature is invalid, for example signature does not match.

Example: verify a GitHub webhook​

  1. Create an API key credential named GitHub webhook secret with the webhook secret as the key.
  2. Add the node after http_trigger and connect valid to your logic and invalid to a response_node that returns 401.
{
"id": "verify_github",
"type": "crypto_node",
"data": {
"config": {
"operation": "hmac_verify",
"credentials_id": "<api key credential id>",
"algorithm": "sha256",
"encoding": "hex",
"signature_prefix": "sha256=",
"use_raw_body": true
},
"inputs": {
"signature": "{{ $json['http_trigger_1'].request.headers['X-Hub-Signature-256'] }}"
}
}
}

Edges: verify_github → ok_response with sourceHandle: "valid", and verify_github → reject_401 with sourceHandle: "invalid".

Provider settings​

ProviderHeaderSettings
GitHubX-Hub-Signature-256sha256, hex, signature_prefix: sha256=, use_raw_body
ShopifyX-Shopify-Hmac-Sha256sha256, base64, use_raw_body
SlackX-Slack-Signaturesha256, hex, signature_prefix: v0=, use_raw_body, payload_prefix as below
StripeStripe-Signature (t=…,v1=…)sha256, hex, use_raw_body, payload_prefix and signature as below

Request headers are lists, so an expression that works on a header value uses [0]:

Slack payload_prefix:  v0:{{ $json['http_trigger_1'].request.headers['X-Slack-Request-Timestamp'][0] }}:
Stripe payload_prefix: {{ $json['http_trigger_1'].request.headers['Stripe-Signature'][0].split(',').find(p => p.startsWith('t=')).slice(2) + '.' }}
Stripe signature: {{ $json['http_trigger_1'].request.headers['Stripe-Signature'][0].split(',').find(p => p.startsWith('v1=')).slice(3) }}

For Stripe and Slack, also reject old timestamps (for example with a condition_node) so a captured request cannot be replayed.

Common pitfalls​

  • Leaving use_raw_body off for webhooks. The JSON body is re-encoded and the signature never matches.
  • Using a credential type other than API key. The node returns credential must be of type api_key.
  • Switching the operation between verify and the others in the builder renames the branch handles (valid/invalid ↔ success/error); existing connections are kept.
  • use_raw_body needs an http_trigger; in cron, Kafka or IMAP workflows pass data instead.