# decrypt

## Description

Decrypt the value passed.

## Input / Parameter

| Name   | Description                                                  | Input Type | Default | Options     | Required               |
| ------ | ------------------------------------------------------------ | ---------- | ------- | ----------- | ---------------------- |
| text   | The value to be decrypted.                                   | Text       | -       | -           | Yes                    |
| type   | The type of encryption to use.                               | Text       | aes     | aes, aes256 | Yes                    |
| key    | The key to be used for the decryption.                       | Text       | -       | -           | Yes                    |
| vector | The vector used for decryption. (Required for type ‘aes256’) | Text       | -       | -           | Only for type 'aes256' |

## Output

| Description                 | Output Type |
| --------------------------- | ----------- |
| Returns the decrypted text. | String/Text |

## Example

In this example, we will attempt to decrypt an already encrypted text.

### Steps

1. Drag a `button` component into the canvas and open the `Action` tab. Select the `press` event of the button.
2. Add `Log.write` function and add a subflow on its value, then put `Text.decrypt` inside it. Fill the parameter accordingly.

   * The text is taken from result of Text.encrypt() documentation.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-a6c4bf105e282232c24851549118645d594f9ced%2Fdecrypt-step-1.png?alt=media)

### Result

1. The console on preview will show the decrypted text.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-9dcbdc5773f65316ad3e849dbf3c10fb72d6bde3%2Fdecrypt-result-1.png?alt=media)

## Links

### Related Information
