HMAC-SHA256 Hash Set Keytype to HEX?

Hi, where i can set the HMAC Key ? I want to build a HMAC-SHA256 hash ?
The Algorythm dont take out the right hash value.

What can i do ?

Thanks,
Stefan

Hi there, i would make these:


But i dont get the right result.

The Problem is that the Secret for HMAC must be a HEX. How i can convert ?

Hi, how i can set here the Type of the Secret ? I would like to set it as a hex.

What do you think ?

Thanks,
Stefan
@jan Can you help ?

Finally, is my question how i can set the Keytype to Hex ?

Have sadly honestly no experience there at all. What you can try, if you have a hex-string is to set the Parameter “Secret” to an expression and then to something like:

{{ Buffer.from("YOUR_HEX_STRING", "hex") }}

@Stefan check the workflow below:

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        360
      ]
    },
    {
      "parameters": {
        "action": "hmac",
        "type": "SHA256",
        "value": "41791234567",
        "secret": "={{Buffer.from('85adf8226953f3d96cfd5d09bf29555eb955fcd8aa5ec4f9fcd869e258370723', 'hex')}}"
      },
      "name": "Crypto",
      "type": "n8n-nodes-base.crypto",
      "typeVersion": 1,
      "position": [
        560,
        360
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Crypto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Ricardo, that was it !
Thanks a lot !

1 Like