---
title: "encrypt"
canonical: "https://support.appfire.com/space/PSCONF/15305477/encrypt"
format: markdown
---
> Macro (aura-html)


 > Macro (button-handy)




> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | encrypt(textToEncrypt, cipherKey) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Encrypts text with AES encryption using a 16, 32, 64, or 128 bit cipher.

Encrypts text with AES encryption using a 16, 32, 64, or 128 bit cipher. This is useful when using [Persistent variables](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15303666) to store passwords. Returns the encrypted input text.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | textToEncrypt | String | Yes | Text to encrypt |
> | cipherKey | String | Yes | Secret cipher key text used for encryption and decryption. Must be 16, 32, 64, or 128 characters in length. |

## Return Type

**String**

Returns the encrypted input text

## Example

```javascript
return encrypt("adminPassword", "secretKeyPhrase7");
```

## See also

> Macro (contentbylabel)