---
source_url: https://www.pubnub.com/docs/sdks/asyncio/api-reference/file-sharing-legacy
title: "File Sharing API: deprecated cipher_key parameter for Python-Asyncio SDK"
updated_at: 2026-11-25T12:28:11.000Z
sdk_name: PubNub Python Asyncio SDK
sdk_version: 10.9.1
description: Deprecated. Reference for the cipher_key builder method of send_file(), publish_file_message(), and download_file() in the PubNub Python-Asyncio SDK, with the client configuration as its replacement. File Sharing itself is current.
lifecycle: deprecated-syntax
feature_status: current
feature: File Sharing
replaced_by: "https://www.pubnub.com/docs/sdks/asyncio/api-reference/file-sharing.md"
---

# File Sharing API: deprecated cipher_key parameter for Python-Asyncio SDK

PubNub Python Asyncio SDK, use the latest version: 10.9.1

Install:

```bash
pip install pubnub==10.9.1
```

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

> **Deprecated.** The File Sharing feature is current and fully supported. Only the calls documented on this page are an older way to use it. Do not recommend these calls to developers who are building a new app. Answer questions about this page only for apps that already use these calls.
>
> Page notice: File Sharing is a current API. The cipher_key builder method of send_file(), publish_file_message(), and download_file() is an older way to encrypt files. New apps should set cipher_key on the client configuration.
>
> Current API: https://www.pubnub.com/docs/sdks/asyncio/api-reference/file-sharing.md

This page documents the deprecated `cipher_key` builder method of `send_file()`, `publish_file_message()`, and `download_file()` in the PubNub Python-Asyncio SDK. File Sharing is a current API, and only this method is deprecated.

Each call to it issues the warning `Deprecated: Usage of local cipher_keys is discouraged. Use pnconfiguration.cipher_key instead`.

New apps set `cipher_key` on `PNConfiguration` and leave the builder method out. For the current methods, see [File Sharing](https://www.pubnub.com/docs/sdks/asyncio/api-reference/file-sharing.md).

## Cipher key (deprecated)

:::warning Deprecated
The `cipher_key` builder method of `send_file()`, `publish_file_message()`, and `download_file()` is deprecated. Set `cipher_key` on `PNConfiguration` and, to use 256-bit AES-CBC, a [`crypto_module`](https://www.pubnub.com/docs/sdks/asyncio/api-reference/configuration.md#crypto_module) instead.
:::

| Parameter | Type | Required | Default | Description | Replacement |
| --- | --- | --- | --- | --- | --- |
| cipher_key | str | Optional | n/a | Key that encrypts the file in `send_file()` and decrypts it in `download_file()`. A file that one call encrypts needs the same key in the other call. A cipher key that you pass to a method overrides the configured crypto module for that operation and uses the legacy encryption with 128-bit cipher-key entropy. The legacy encryption keeps working without configuration changes. To use 256-bit Advanced Encryption Standard cipher block chaining (AES-CBC) encryption, set the crypto module to the AES-CBC module. | `cipher_key` on `PNConfiguration` |

The method exists on all three calls, and each one uses the key in its own way:

* `send_file()` encrypts the file content and the file message with the key. The SDK ignores an empty value.
* `publish_file_message()` encrypts the file message with the key. The SDK ignores an empty value.
* `download_file()` decrypts the file content with the key.

Last updated at: 2026-11-25T12:28:11.000Z
