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

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

# TINES_DECRYPT

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

Decrypts text using Tines encryption. TINES_DECRYPT enforces expiration: attempting to decrypt expired data raises an error. Expiration has second granularity and is subject to clock skew.
Arguments:

encrypted: The encrypted ciphertext must be the direct output of TINES_ENCRYPT.

key: A key of at least 32 bytes.

**Categories:** Encryption

## Syntax

```
TINES_DECRYPT(encrypted, key)
```

## Examples

### Example 1

Formula:

```
TINES_DECRYPT(my_action.encrypted_message, CREDENTIAL.secret_key)
```

## Sample actions

```json
{
  "standardLibVersion": "70",
  "actionRuntimeVersion": "2",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "otZMcEgEhODINSIB1g3Yz9lqUBZymCp7QiP0ajBeXFAWRfZerTYkDF5jormeYSBr"
        }
      },
      "position": {
        "x": 1980,
        "y": 1740
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "TINES_DECRYPT",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "tines_decrypt": "=TINES_DECRYPT(my_action.message, CREDENTIAL.aes_secret_key)"
        }
      },
      "position": {
        "x": 1980,
        "y": 1830
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
