Reference · Tools
Crypto
Hash, HMAC, sign data, and generate random values using Node.js cryptography.
The Crypto node computes hashes, HMACs, digital signatures, and random values entirely within your workflow using Node.js — no network calls, no external services. You can use it to hash a user password before storing it, generate a random API key in base64, or sign a payload with a private key. All four operations write their result to a named property you define.
- Node type
- Action
- Parameters
- 13
- Outputs
- Output, Error
- Credentials
- Crypto Credential
Crypto
Hash, HMAC, sign, and generate random values
Overview
The Crypto tool provides four cryptographic actions: (1) hash — compute a hash of a string value using MD5, SHA256, SHA384, SHA512, or SHA3 variants; (2) hmac — compute HMAC using a secret key; (3) sign — create a digital signature using a private key; (4) generate — create random values as UUID, hex, base64, or ASCII strings. No external dependencies and no network calls — everything is computed locally.
Category: Core Nodes
Tool Name: crypto
Version: 1
Appearance: Icon: lucide-Lock | Color: #5e548e
Node Type
Action — processes input items and produces output
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires Crypto Credential credentials. See the Credentials Guide for setup instructions.
The credential carries the HMAC secret and the signing private key, so it is only read by the hmac and sign actions. The hash and generate actions do not use it.
Parameters
The action you pick decides which of the remaining parameters are shown.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Action | options | No | hash | The cryptographic operation to perform. |
Options: generate (random string — UUID, hex, base64, ASCII), hash (hash a string value), hmac (HMAC a string value with a secret), sign (sign a string with a private key) |
Hash (hash) and Hmac (hmac)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Type | options | No | SHA256 | The hash algorithm to use. |
Options: MD5, SHA256, SHA3-256, SHA3-384, SHA3-512, SHA384, SHA512 | ||||
| Value | string | Yes | — | The string value to hash/HMAC. Supports expressions like {{ $json.password }}. |
| Property Name | string | No | data | The property name to write the result to. |
| Encoding | options | No | hex | Output encoding. |
Options: base64, hex |
Sign (sign)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Algorithm | options | No | SHA256 | The signature algorithm. |
Options: MD5, SHA1, SHA224, SHA256, SHA384, SHA512 | ||||
| Value | string | Yes | — | The string value to sign. Supports expressions like {{ $json.document }}. |
| Property Name | string | No | data | The property name to write the signature to. |
| Encoding | options | No | hex | Encoding of the signature written to the output property. |
Options: base64, hex |
Generate (generate)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Encoding Type | options | No | uuid | The type of random value to generate. |
Options: ascii (letters and digits), base64, hex, uuid (a random UUID — String Length does not apply) | ||||
| String Length | number | No | 32 | The length of the random string to generate. (shown when Encoding Type is ascii, base64, hex) |
| Property Name | string | No | data | The property name to write the result to. |
All Actions
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Max Concurrency | number | No | 10 | Maximum number of items to process concurrently. |
Output Data
One output item per input item. The item JSON passes through unchanged and binary data is forwarded; the node adds a single property, named by Property Name (data by default), holding the result as a string.
| Action | Value written to the property |
|---|---|
hash | The digest of Value, in the chosen Encoding. |
hmac | The HMAC of Value computed with the credential’s HMAC secret, in the chosen Encoding. |
sign | The signature of Value produced with the credential’s private key, in the chosen Encoding. |
generate | A random UUID, or a random ascii / base64 / hex string of String Length characters. |
Reference the result downstream by expression, for example {{ $json.data }} — or by whatever name you set in Property Name:
{
"email": "user@example.com",
"passwordHash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"
}
Because the property is written onto the existing item, setting Property Name to a field that is already present overwrites it.
Usage Examples
- Hash a password with SHA256
- Generate a UUID
- Create HMAC signature for API authentication
- Sign data with RSA private key
Example Configuration
Hash a fixed string with SHA256 and write it to hashedValue:
{
"type": "crypto",
"parameters": {
"action": "hash",
"type": "SHA256",
"value": "Hello World",
"dataPropertyName": "hashedValue",
"encoding": "hex",
"maxConcurrency": 10
}
}
HMAC a value with the credential’s secret:
{
"type": "crypto",
"parameters": {
"action": "hmac",
"type": "SHA256",
"value": "sensitive data",
"dataPropertyName": "hmacSignature",
"encoding": "base64",
"maxConcurrency": 5
}
}
Sign a document string with the credential’s private key:
{
"type": "crypto",
"parameters": {
"action": "sign",
"algorithm": "SHA256",
"value": "document to sign",
"dataPropertyName": "digitalSignature",
"encoding": "base64",
"maxConcurrency": 10
}
}
Generate a UUID:
{
"type": "crypto",
"parameters": {
"action": "generate",
"encodingType": "uuid",
"dataPropertyName": "generatedUuid",
"maxConcurrency": 10
}
}
Generate a 32-character random hex string:
{
"type": "crypto",
"parameters": {
"action": "generate",
"encodingType": "hex",
"stringLength": 32,
"dataPropertyName": "randomHex",
"maxConcurrency": 10
}
}
Generate a 16-character random ASCII string:
{
"type": "crypto",
"parameters": {
"action": "generate",
"encodingType": "ascii",
"stringLength": 16,
"dataPropertyName": "randomString",
"maxConcurrency": 10
}
}
Hash a value taken from the incoming item:
{
"type": "crypto",
"parameters": {
"action": "hash",
"type": "SHA256",
"value": "{{ $json.password }}",
"dataPropertyName": "passwordHash",
"encoding": "hex"
}
}
Produce an integrity check over item content:
{
"type": "crypto",
"parameters": {
"action": "hmac",
"type": "SHA512",
"value": "{{ $json.fileContent }}",
"dataPropertyName": "integrityHash",
"encoding": "base64"
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Hash, HMAC, sign, or generate random values using Node.js crypto — no external dependencies.
Parameter Relationships
- Hash and Hmac use Type, Value, Property Name and Encoding.
- Sign uses Algorithm, Value, Property Name and Encoding.
- Generate uses Encoding Type, Property Name, and String Length for everything except UUID.
Common Patterns
- Password hashing —
hashwithSHA256over{{ $json.password }}, written to a dedicated property. - API key generation —
generatewithbase64and a longer String Length such as 48. - Data integrity check —
hmacwithSHA512over the content you want to protect. - Session tokens —
generatewithuuid, which ignores String Length.
This node works on strings. To hash the contents of a file, use the Crypto (Binary Hash) node instead.
Frequently asked questions
What is the Crypto Credential used for, and when do I actually need it?
The Crypto Credential (cryptoCredential) is required for the HMAC and Sign actions, which need a secret key or private key to compute their output. The Hash and Generate actions work on their own and do not require a credential to be configured.
I want to hash file contents — can I use this node for that?
No. The Crypto node operates on strings only. If you need to hash the binary contents of a file, use the Crypto (Binary Hash) node instead. Passing a file reference as a string value here will not produce a meaningful hash of the file's actual bytes.
Does the String Length parameter apply to every Generate output type?
No — String Length is ignored when the Encoding Type is set to UUID. UUID always produces a standard 36-character v4 UUID regardless of what you enter in that field. String Length only takes effect for hex, base64, and ASCII output types.
What algorithms are available, and does the choice differ between Hash and Sign?
For Hash and HMAC you select a Type (MD5, SHA256, SHA384, SHA512, or SHA3 variants). For Sign you select an Algorithm separately — the parameter is named differently because signing algorithms depend on the private key type, not just the digest. Make sure you match the algorithm to the key you have configured in your credential.
What happens if the node fails — does it stop the whole workflow?
The Crypto node has two distinct outputs: Output for successful results and Error for failures. This means you can wire the Error output to a separate branch — for example, to log the failure or return a safe default — rather than letting the entire workflow halt. Any item that cannot be processed will be routed to the Error output instead of Output.
Build with the Crypto node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Crypto Credential credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.