> For the complete documentation index, see [llms.txt](https://docs.digibee.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digibee.com/documentation/connectors-and-triggers/connectors/security/pbe-cryptography.md).

# PBE Cryptography

**PBE Cryptography** performs encryption and decryption using the PBE algorithm (Password-Based Encryption).

## **Parameters**

Configure the connector using the parameters below. Fields that support [Double Braces expressions](/documentation/connectors-and-triggers/double-braces/overview.md) are marked in the **Supports DB** column.

{% tabs %}
{% tab title="General" %}

<table data-header-hidden="false" data-header-sticky><thead><tr><th width="112">Parameter</th><th width="231">Description</th><th width="83">Data type</th><th width="81">Supports DB</th><th width="100">Default value</th><th width="129">Visible when</th></tr></thead><tbody><tr><td><strong>Crypto Operation</strong></td><td>Defines the type of operation to be performed: <strong>Encrypt Fields</strong>, <strong>Decrypt Fields</strong>, <strong>Encrypt Payload</strong>, or <strong>Decrypt Payload</strong>.</td><td>String</td><td>❌</td><td><code>Encrypt Fields</code></td><td>—</td></tr><tr><td><strong>Use Dynamic Account</strong></td><td>If enabled, the connector uses the account dynamically via the <a href="/pages/0kxlZ011XP4A2T43v9kh"><strong>Store Account</strong></a> connector; otherwise, it uses the account statically as configured in <a href="/spaces/jvO5S91EQURCEhbZOuuZ/pages/fS1QLzAg8rGSSJFwtrvy"><strong>Accounts</strong></a> on the Platform.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td>—</td></tr><tr><td><strong>Scoped</strong></td><td>If enabled, isolates the stored account from other sub-processes. Not supported for accounts used in headers or body. To learn more, read the <a href="/spaces/jvO5S91EQURCEhbZOuuZ/pages/cbkYqH3fxzeL7zOKNawz">Dynamic Accounts documentation</a>.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td><strong>Use Dynamic Account</strong> is enabled</td></tr><tr><td><strong>Account Name</strong></td><td>Name of the account defined in the <a href="/pages/0kxlZ011XP4A2T43v9kh"><strong>Store Account</strong></a> connector.</td><td>String</td><td>✅</td><td>N/A</td><td><strong>Use Dynamic Account</strong> is enabled</td></tr><tr><td><strong>Account</strong></td><td>Account to be used by the connector. Must be a <strong>Secret Key</strong> account type, configured in <a href="/spaces/jvO5S91EQURCEhbZOuuZ/pages/fS1QLzAg8rGSSJFwtrvy"><strong>Accounts</strong></a> on the Platform.</td><td>String</td><td>❌</td><td>N/A</td><td><strong>Use Dynamic Account</strong> is disabled</td></tr><tr><td><strong>Iteration Count</strong></td><td>Number of iterations to be performed with the Salt value.</td><td>Integer</td><td>❌</td><td><code>1000</code></td><td>—</td></tr><tr><td><strong>Algorithm</strong></td><td>Algorithm to be used for the encryption or decryption operation.</td><td>String</td><td>❌</td><td><code>PBEWithMD5AndDES</code></td><td>—</td></tr><tr><td><strong>Fields To Encrypt/Decrypt</strong></td><td>Fields to be encrypted or decrypted, specified using dotted notation (e.g., <code>body.field1, body.field2, body</code>).</td><td>String</td><td>❌</td><td><code>a.test</code></td><td>—</td></tr><tr><td><strong>Payload To Encrypt/Decrypt</strong></td><td>Payload to be encrypted or decrypted, specified using dotted notation.</td><td>String</td><td>✅</td><td>N/A</td><td>—</td></tr><tr><td><strong>Charset</strong></td><td>Character encoding used to interpret the text.</td><td>String</td><td>❌</td><td><code>UTF-8</code></td><td>—</td></tr><tr><td><strong>Secret Key Type</strong></td><td>Format of the secret key: <strong>String</strong>, <strong>Hexadecimal</strong>, or <strong>Base64</strong>.</td><td>String</td><td>❌</td><td><code>Base64</code></td><td>—</td></tr><tr><td><strong>Fail On Error</strong></td><td>If enabled, interrupts pipeline execution when an error occurs. Otherwise, execution proceeds and the result returns <code>false</code> for the <code>"success"</code> property.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td>—</td></tr><tr><td><strong>Advanced Settings</strong></td><td>Enables access to advanced configuration options.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td>—</td></tr><tr><td><strong>Use Key From Payload</strong></td><td>If enabled, uses the secret key provided in the payload instead of a fixed key.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td><strong>Advanced Settings</strong> is enabled</td></tr><tr><td><strong>Secret Key</strong></td><td>Secret key value, provided in Hexadecimal or Base64 format.</td><td>String</td><td>❌</td><td>N/A</td><td><strong>Use Key From Payload</strong> is enabled</td></tr><tr><td><strong>Use Salt From Payload</strong></td><td>If enabled, uses the Salt value provided in the payload; otherwise, a new Salt is generated automatically.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td><strong>Advanced Settings</strong> is enabled</td></tr><tr><td><strong>Salt</strong></td><td>Random data string used to modify a password hash.</td><td>String</td><td>❌</td><td>N/A</td><td><strong>Use Salt From Payload</strong> is enabled</td></tr><tr><td><strong>Encryption Key As Hex Value</strong></td><td>If enabled, returns the secret key in hexadecimal format; otherwise, it is returned in Base64 format when the <strong>Use Key From Payload</strong> option is also enabled.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td><strong>Advanced Settings</strong> is enabled</td></tr><tr><td><strong>Salt As Hex Value</strong></td><td>If enabled, returns the Salt value in hexadecimal format; otherwise, it is returned in Base64 format.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td><strong>Advanced Settings</strong> is enabled</td></tr><tr><td><strong>Encrypted Message As Hex</strong></td><td>If enabled, returns the encrypted message in hexadecimal format; otherwise, it is returned in Base64 format.</td><td>Boolean</td><td>❌</td><td><code>false</code></td><td><strong>Advanced Settings</strong> is enabled</td></tr></tbody></table>
{% endtab %}

{% tab title="Documentation" %}

| Parameter         | Description                                                                             | Data type | Supports DB | Default value |
| ----------------- | --------------------------------------------------------------------------------------- | --------- | ----------- | ------------- |
| **Documentation** | Optional field to describe the connector configuration and any relevant business rules. | String    | ❌           | N/A           |

{% endtab %}
{% endtabs %}

### **Messages flow**

#### **Encrypt via fields**

**Input**

```json
{  
    "accountLabel": "account",  
    "params": {    
        "operation": "encrypt_fields",    
        "iterationCount": 1000,    
        "keyType": "STRING",    
        "algorithm": "PBEWithMD5AndDES",    
        "encryptedFields": "a.test",    
        "failOnError": true  
    }
}
```

**Payload**

```json
{  
    "a": {    
        "test": "test"  
    }
}
```

**Output**

```json
{  
    "a": {    
        "test": "ZmRmcw=="  
    },  
    "_salt": "ZmRmcwZmRmcw=="
}
```

#### **Decrypt via fields**

**Input**

```json
{  
    "accountLabel": "account",  
    "params": {    
        "operation": "decrypt_fields",    
        "iterationCount": 1000,    
        "keyType": "STRING",    
        "algorithm": "PBEWithMD5AndDES",    
        "encryptedFields": "a.test",    
        "useSaltFromPayload": true,    
        "salt": "{{ message._salt }}",    
        "failOnError": true  
    }
}
```

**Payload**

```json
{  
    "a": {    
        "test": "ZmRmcw=="  
    },  
    "_salt": "ZmRmcwZmRmcw=="
}
```

**Output**

```json
{  
    "a": {    
        "test": "test"  
    },  
    "_salt": "ZmRmcwZmRmcw=="
}
```

#### **Encrypt via payload**

**Input**

```json
{
    "accountLabel": "pbe",    
        "params": {        
            "operation": "encrypt_payload",        
            "iterationCount": 1000,        
            "payload": "{{ message.a.test }}",        
            "keyType": "STRING",        
            "algorithm": "PBEWithMD5AndDES",        
            "failOnError": true    
        }
    }
```

**Payload**

```json
{  
    "a": {    
        "test": "test"  
    }
}
```

**Output**

```json
{  
    "a": {    
        "test": "test"  
    },  
    "result": "ZmRmcw==",  
    "_salt": "ZmRmcwZmRmcw=="
}
```

#### **Decrypt via payload**

**Input**

```json
{
    "accountLabel": "pbe",    
    "params": {        
            "operation": "decrypt_payload",        
            "iterationCount": 1000,        
            "payload": "{{ message.a.test }}",        
            "keyType": "STRING",        
            "algorithm": "PBEWithMD5AndDES",        
            "useSaltFromPayload": true,
            "salt": "{{ message._salt }}",        
            "failOnError": true    
     }
}
```

**Payload**

```json
{  
    "a": {    
        "test": "ZmRmcw=="  
    }
}
```

**Output**

```json
{  
    "a": {    
        "test": "ZmRmcw=="  
    },  
    "result": "test",  
    "_salt": "ZmRmcwZmRmcw=="
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digibee.com/documentation/connectors-and-triggers/connectors/security/pbe-cryptography.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
