> For the complete documentation index, see [llms.txt](https://support.marscat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.marscat.io/development-guide/frontend-development/api-interface/api-interface-details/level-0/encrypt.md).

# encrypt

Uses the current MarsApp ECC public key to encrypt content. Can be used for encrypted transmission of user sensitive data.

## Request Parameters

| Parameter Name | Type   | Required | Description                        |
| -------------- | ------ | -------- | ---------------------------------- |
| message        | String | Yes      | Plaintext content to be encrypted. |

## Response Parameters

| Parameter Name | Type   | Description                         |
| -------------- | ------ | ----------------------------------- |
| result         | String | Encryption result (Base64 encoded). |

## Call Example

{% code title="example.js" %}

```javascript
let payload = {
  message: "Sensitive Info"
};

const response = await relayx.encrypt(payload);
if (response.code === 200) {
  console.log("Encrypted:", response.result);
}
```

{% endcode %}
