---
title: Encrypt Text API
slug: encrypt
url: https://apyhub.com/dosvak/service/encrypt
provider: Dosvak LLC
categories: ["Security & Privacy"]
tags: [encryption, fernet, ciphertext, text-encryption, security]
auth: api_key
---

# Encrypt Text API

Encrypt a text string with Fernet and get back ciphertext, plus the key used if you omit one. Useful for protecting sensitive payloads in apps.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `` | What it does Encrypts a text string using Fernet and returns the resulting ciphertext. If you do no… | 10 |

## About

## What it does
Text Encryption lets you encrypt a text string with Fernet and returns the resulting ciphertext. You send a `text` value, and you can also provide a Base64-url Fernet `key` if you want to control the encryption key yourself.

If you omit `key`, the service auto-generates one and includes it in the response alongside the `ciphertext`. That makes it useful when you need to encrypt small payloads for storage, transport, or internal workflows without managing key generation separately.

Use Text Encryption when you need to protect secrets, API payloads, tokens, or other sensitive text before writing it to a database, sending it between services, or passing it through a queue. The response is compact and direct: you get the key used and the encrypted output back.

It is a focused utility for application-level encryption, not a general file or document encryption workflow. If your input is plain text and your output needs to be ciphertext, this endpoint gives you exactly that.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/dosvak/service/encrypt
