// guides · n8n error index

n8n Crypto node not working: HMAC webhook signatures that never match, missing secret and errors, 57 runs

Why your n8n HMAC never matches the webhook signature (JSON.stringify vs the raw body, hex vs base64, sha256= prefix, secret whitespace), the missing Crypto credential in v2, value type errors, and Sign, Encrypt and Decrypt errors. 57 real runs on n8n 2.43.7.

Updated 2026-10-24 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. HMAC the raw body, not JSON.stringify($json.body)

    This is the main reason a webhook signature "works in testing and fails with Stripe or Shopify". The Webhook node parses the body, so spaces, newlines, 10.50 (it becomes 10.5) and escapes such as \/ and \u00e9 are gone. The HMAC of JSON.stringify($json.body) was bd39a0d0... while the sender signed 473f7b8e.... It only matched when the sender sent compact JSON with nothing escaped. The fix that matched every time, in 6 production webhook runs: on the Webhook node turn on Options > Raw Body, then in the Crypto node (Action Hmac) turn on Binary File with Binary Property Name data. With Raw Body off, Binary File fails: This operation expects the node's input data to contain a binary file 'data', but none was found [item 0].

  2. On n8n 2.x the secret lives in a Crypto credential

    The Crypto node v2 (the default in n8n 2.x) has no Secret field, so tutorials and screenshots showing one are for v1. With no credential selected, the run failed with Node does not have any credentials set. With a Crypto credential that has no HMAC secret: No HMAC secret set in credentials. Please add an HMAC secret to your Crypto credentials. Create a credential of type Crypto, fill the HMAC secret, and select it. v1 with the same inline secret gave the same HMAC, and with an empty secret: Parameter "Secret" is required.

  3. Check the silent mismatches: secret, algorithm, encoding, signed string

    All of these gave a green run and a wrong value, with no warning. A trailing space in the secret, or a newline pasted with it, changed the HMAC. SHA1 instead of SHA256 changed it. Encoding matters: hex and base64 are the same bytes written differently, and Shopify sends base64, while GitHub and Stripe send hex. Some providers sign more than the body: for Stripe the signed string is the timestamp, a dot and the raw body ({{ $json.t }}.{{ $json.raw }} matched our reference), and Slack documents v0:timestamp:body. Check your provider's docs for the exact string.

  4. Compare with the right prefix and case

    Even with the correct HMAC, an IF node comparison failed when the header had a prefix: GitHub sends sha256=<hex> and the node outputs only the hex, so it went to the false branch. An UPPERCASE hex header against the node's lowercase output also went to false. Compare 'sha256=' + $json.data with the header, or lowercase both sides. The IF node has no timing-safe comparison, so if that matters to you, compare in a Code node.

  5. Make Value a string

    Value must resolve to text. A number field failed with The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (123), an object with ...Received an instance of Object, and a missing field with ...Received undefined. Use {{ String($json.n) }}, or {{ JSON.stringify($json.obj) }} for objects (but see step 1 for webhook bodies). An empty Value gave Parameter "Value" is required. If you type {{ $json.text }} in Fixed mode, without switching to Expression, the node hashes that literal text. A trailing newline also changes the hash.

  6. Hashing a file removes the file from the item

    With Binary File on, the SHA256 matched sha256sum, but the next node had no binary: the Crypto node outputs the item without it, in every run including all webhook runs. If you still need the file, hash it on a separate branch and join with a Merge node. Two more traps: Property Name meta.hash creates a flat key named meta.hash, not a nested field, and a Property Name that already exists (the default is data) is overwritten.

  7. Sign, Encrypt and Decrypt errors

    Sign with RSA-SHA256 verified with openssl. A PEM pasted on one line still worked, but the key body without the BEGIN and END lines failed with error:1E08010C:DECODER routines::unsupported, and a credential with no private key gave No private key set in credentials. Please add a private key to your Crypto credentials. Encrypt and Decrypt (new in v2) round-tripped AES-256-GCM. A wrong passphrase, a different cipher or a different RSA OAEP hash all gave Decryption failed: wrong passphrase, key, cipher, or corrupted payload. A CryptoJS or openssl string starting U2FsdGVkX1 gave Ciphertext is malformed or truncated: the node only decrypts what it encrypted itself. RSA with 300 characters gave Plaintext is too large for the RSA key. Use symmetric mode for larger data. Encrypting the same text twice gave two different ciphertexts, so you can't compare or deduplicate on ciphertext.

  8. Generate: don't use ASCII for tokens

    Generate UUID gave a different value per item, Hex 32 gave 32 hex characters, and Base64 32 gave 32 characters. ASCII 16 produced control characters such as \u0011, which break headers, URLs and passwords. Use Hex or UUID for tokens.

What we ran

On 24 October 2026 we ran 57 executions on self-hosted n8n 2.43.7: 51 with n8n execute (Manual Trigger, a Code node with test data, the Crypto node v2, two runs on v1) and 6 production webhook runs with Raw Body on and off, sent with curl. We checked every hash, HMAC and signature outside n8n with sha256sum, Python hmac and openssl, and n8n's outputs matched them.

SetupResult
Hash SHA256, Encoding Hex, Value hello2cf24dba..., same as sha256sum
Hash MD5, Encoding Base64XUFAKrxLKna5cZ2REBfFkg==
Value left emptyError: Parameter "Value" is required.
Value {{ $json.obj }} (an object)Error: ...Received an instance of Object
Value {{ $json.missing }} (field doesn't exist)Error: ...Received undefined
Value {{ $json.n }} (the number 123)Error: ...Received type number (123)
Value {{ String($json.n) }}Works: a665a459...
Value with a trailing newlineDifferent hash 5891b5b5..., no warning
Binary File on, 3000-byte fileHash matched sha256sum; the next node had no binary any more
Binary Property Name file (the file is in data)Error: The item has no binary field 'file' [item 0]
Binary File on, item has no binaryError: ...expects the node's input data to contain a binary file 'data', but none was found [item 0]
Property Name meta.hashA flat key literally named meta.hash, not nested
Property Name text (an existing input field)Input field overwritten with the hash
Value typed without = (Fixed mode) {{ $json.text }}Hash of the literal text {{ $json.text }}, green run
HMAC v2, no credential selectedError: Node does not have any credentials set
HMAC v2, Crypto credential without an HMAC secretError: No HMAC secret set in credentials. Please add an HMAC secret to your Crypto credentials.
HMAC SHA256 hex of the raw body string473f7b8e..., same as Python hmac
Same HMAC, Encoding Base64Rz97joJp...=: the same bytes in base64
HMAC of JSON.stringify($json.body) after the Webhook parsed itbd39a0d0..., not the sender's 473f7b8e...
Secret with a trailing spaceaa82703e..., silent mismatch
Secret with a pasted newline4199c7bc..., silent mismatch
SHA1 instead of SHA256d4fe4999..., silent mismatch
Stripe-style signed string {{ $json.t }}.{{ $json.raw }}Matched Python
IF: node output (hex) vs header sha256=<hex>False branch
IF: lowercase hex vs UPPERCASE hex headerFalse branch
HMAC v1, inline SecretSame 473f7b8e... as v2
HMAC v1, empty SecretError: Parameter "Secret" is required.
HMAC on a binary made from the raw body473f7b8e..., match
Production webhook, Raw Body on, pretty JSONBinary HMAC matched; stringify HMAC didn't
Production webhook, Raw Body off, Binary File onError: ...binary file 'data', but none was found
Production webhook, compact JSON (Raw Body on or off)Both methods matched
Production webhook, Raw Body on, body with \/ and \u00e9Binary HMAC matched; stringify HMAC didn't
Sign RSA-SHA256, base64openssl verify: Verified OK
Sign with the PEM pasted on one lineSame signature, works
Sign with the key body but no BEGIN/END linesError: error:1E08010C:DECODER routines::unsupported
Sign, Algorithm left emptyError: Parameter "Algorithm Name or ID" is required.
Sign, credential without a private keyError: No private key set in credentials. Please add a private key to your Crypto credentials.
Encrypt then Decrypt, AES-256-GCMhello back
Decrypt with a wrong passphrase, or with aes-128-gcmError: Decryption failed: wrong passphrase, key, cipher, or corrupted payload
Decrypt a CryptoJS/openssl U2FsdGVkX1... string, or short base64Error: Ciphertext is malformed or truncated
RSA encrypt 300 charactersError: Plaintext is too large for the RSA key. Use symmetric mode for larger data.
RSA OAEP sha256 encrypt, sha1 decryptError: Decryption failed
RSA decrypt with only a public key in the credentialError: No encryption private key set in credentials
Encrypt the same text twiceTwo different ciphertexts
Generate UUID / Hex 32 / Base64 32 / ASCII 16Distinct UUIDs / 32 hex chars / 32 chars / control characters such as \u0011

Signature mismatch checklist

Good to know

What we didn't test

FAQ

Why does my n8n HMAC not match the webhook signature?

In our runs the usual cause was hashing JSON.stringify of the parsed body. n8n parses the JSON, so the text is no longer byte-for-byte what the sender signed. Turn on Raw Body in the Webhook node and HMAC the binary data property with Binary File on. Then check the secret for spaces, the algorithm, hex vs base64, and any prefix such as sha256=.

Where is the Secret field in the n8n Crypto node?

On Crypto node v2, the default in n8n 2.x, the HMAC secret is in a credential of type Crypto, not in the node. Without one you get "Node does not have any credentials set"; with an empty HMAC secret you get "No HMAC secret set in credentials".

How do I verify a Shopify webhook in n8n?

Shopify sends the HMAC in base64, so set the Crypto node Encoding to Base64, HMAC the raw body (Raw Body on, Binary File on), and compare with the X-Shopify-Hmac-Sha256 header.

How do I verify a GitHub webhook signature in n8n?

HMAC SHA256 the raw body in hex, then compare "sha256=" plus the result with the X-Hub-Signature-256 header. Comparing the bare hex with the header goes to the false branch.

Why does the n8n Crypto node lose my file?

When you hash a binary file, the output item no longer has the binary. Hash it on a separate branch and merge back, or hash after you have used the file.

What does "Ciphertext is malformed or truncated" mean in n8n?

The Decrypt action only reads ciphertext made by the Crypto node's own Encrypt action. Strings from CryptoJS or openssl (starting U2FsdGVkX1) or other tools gave this error in our runs.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.