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.operation | What it does | Branch outputs |
|---|---|---|
hmac_verify (default) | Computes the HMAC of the data and compares it with the received signature in constant time. | valid, invalid |
hmac_sign | Returns the HMAC of the data in result. | success, error |
hash | Returns the SHA digest of the data in result. | success, error |
base64_encode | Returns the data as Base64 in result. | success, error |
base64_decode | Decodes standard or URL-safe Base64, with or without padding. | success, error |
uuid | Returns 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),sha512orsha1(only for providers that still require it).encoding:hex(default),base64orbase64url. Forhmac_verifythis is the format of the received signature; hex is case-insensitive and Base64 padding is optional.signature_prefix: for examplesha256=(GitHub). On verify it must be present and is removed before comparing; on sign it is added toresult.use_raw_body: use the exact request body bytes received by the workflow'shttp_triggeras 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 whenuse_raw_bodyis on.payload_prefix(optional): text placed directly before the data, for providers that signtimestamp + "." + body(Stripe) orv0:timestamp:body(Slack).signature(hmac_verify): the received signature, usually a request header. Request headers are lists; the first value is used, soheaders['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 forhmac_verify.error: why the operation failed or the signature is invalid, for examplesignature does not match.
Example: verify a GitHub webhook
- Create an API key credential named
GitHub webhook secretwith the webhook secret as the key. - Add the node after
http_triggerand connectvalidto your logic andinvalidto aresponse_nodethat returns401.
{
"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
| Provider | Header | Settings |
|---|---|---|
| GitHub | X-Hub-Signature-256 | sha256, hex, signature_prefix: sha256=, use_raw_body |
| Shopify | X-Shopify-Hmac-Sha256 | sha256, base64, use_raw_body |
| Slack | X-Slack-Signature | sha256, hex, signature_prefix: v0=, use_raw_body, payload_prefix as below |
| Stripe | Stripe-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_bodyoff 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_bodyneeds anhttp_trigger; in cron, Kafka or IMAP workflows passdatainstead.