<!-- BusyBot node reference — https://busybot.net/tools/crypto/ -->

> Node: Crypto (`crypto`) · Action · v1
> Category: Core Nodes · Credentials: Crypto Credential (`cryptoCredential`)
> Updated: 2026-08-16

# 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](https://busybot.net/credentials/crypto-credential/) 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**:

```json
{
  "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`:

```json
{
  "type": "crypto",
  "parameters": {
    "action": "hash",
    "type": "SHA256",
    "value": "Hello World",
    "dataPropertyName": "hashedValue",
    "encoding": "hex",
    "maxConcurrency": 10
  }
}
```

HMAC a value with the credential's secret:

```json
{
  "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:

```json
{
  "type": "crypto",
  "parameters": {
    "action": "sign",
    "algorithm": "SHA256",
    "value": "document to sign",
    "dataPropertyName": "digitalSignature",
    "encoding": "base64",
    "maxConcurrency": 10
  }
}
```

Generate a UUID:

```json
{
  "type": "crypto",
  "parameters": {
    "action": "generate",
    "encodingType": "uuid",
    "dataPropertyName": "generatedUuid",
    "maxConcurrency": 10
  }
}
```

Generate a 32-character random hex string:

```json
{
  "type": "crypto",
  "parameters": {
    "action": "generate",
    "encodingType": "hex",
    "stringLength": 32,
    "dataPropertyName": "randomHex",
    "maxConcurrency": 10
  }
}
```

Generate a 16-character random ASCII string:

```json
{
  "type": "crypto",
  "parameters": {
    "action": "generate",
    "encodingType": "ascii",
    "stringLength": 16,
    "dataPropertyName": "randomString",
    "maxConcurrency": 10
  }
}
```

Hash a value taken from the incoming item:

```json
{
  "type": "crypto",
  "parameters": {
    "action": "hash",
    "type": "SHA256",
    "value": "{{ $json.password }}",
    "dataPropertyName": "passwordHash",
    "encoding": "hex"
  }
}
```

Produce an integrity check over item content:

```json
{
  "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

1. **Hash and Hmac** use **Type**, **Value**, **Property Name** and **Encoding**.
2. **Sign** uses **Algorithm**, **Value**, **Property Name** and **Encoding**.
3. **Generate** uses **Encoding Type**, **Property Name**, and **String Length** for everything except UUID.

### Common Patterns

- **Password hashing** — `hash` with `SHA256` over `{{ $json.password }}`, written to a dedicated property.
- **API key generation** — `generate` with `base64` and a longer **String Length** such as 48.
- **Data integrity check** — `hmac` with `SHA512` over the content you want to protect.
- **Session tokens** — `generate` with `uuid`, which ignores **String Length**.

This node works on strings. To hash the contents of a file, use the Crypto (Binary Hash) node instead.