---
title: RSA_DECRYPT
url: https://www.tines.com/docs/formulas/functions/rsa-decrypt/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# RSA_DECRYPT

*[View on tines.com](https://www.tines.com/docs/formulas/functions/rsa-decrypt/)*

Decrypts encrypted data using a public or private key. A padding choosing from "PKCS1_PADDING", "PKCS1_OAEP_PADDING" and "SSLV23_PADDING" can be passed in with "PKCS1_PADDING" being the default.

**Categories:** Encryption

## Syntax

```
RSA_DECRYPT(encrypted_message, key, [padding: "PKCS1_PADDING"])
```

## Examples

### Example 1

Formula:

```
RSA_DECRYPT(encrypted_data, key)
```

Output:

```json
"Decrypted message"
```

### Example 2

Formula:

```
RSA_DECRYPT(encrypted_data, key, padding: "PKCS1_PADDING")
```

Output:

```json
"Decrypted data"
```

## Sample actions

```json
{
  "standardLibVersion": "20",
  "actionRuntimeVersion": "4",
  "agents": [
    {
      "disabled": false,
      "name": "pems",
      "description": null,
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "=GENERATE_RSA_KEYS()"
        }
      },
      "position": {
        "x": 855,
        "y": -675
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null,
      "cardIconName": null,
      "createdFromTemplateGuid": null,
      "createdFromTemplateVersion": null
    },
    {
      "disabled": false,
      "name": "encrypt message",
      "description": null,
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "<<RSA_ENCRYPT(\"my message\",pems.message[1]) |> BASE64_ENCODE(%)>>"
        }
      },
      "position": {
        "x": 855,
        "y": -555
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null,
      "cardIconName": null,
      "createdFromTemplateGuid": null,
      "createdFromTemplateVersion": null
    },
    {
      "disabled": false,
      "name": "decrypt message",
      "description": null,
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "<<encrypt_message.message |> BASE64_DECODE(%) |> RSA_DECRYPT(%, pems.message[0])>>"
        }
      },
      "position": {
        "x": 855,
        "y": -450
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null,
      "cardIconName": null,
      "createdFromTemplateGuid": null,
      "createdFromTemplateVersion": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    },
    {
      "sourceIdentifier": 1,
      "receiverIdentifier": 2
    }
  ],
  "diagramNotes": []
}
```
