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


 


|  |  |  |  |
| --- | --- | --- | --- |
| **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/pages/createpage.action?spaceKey=psj&title=Persistent%20variables&linkCreation=true&fromPageId=15489290) to store passwords. Returns the encrypted input text.

## Parameters

| 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)