For AI agents: this page in Markdown: https://www.pubnub.com/docs/sdks/asyncio/api-reference/file-sharing-legacy.md. Documentation index: https://www.pubnub.com/llms-full.txt.
File Sharing API: deprecated cipher_key parameter for Python-Asyncio SDK
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.
Cipher key (deprecated)
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 instead.
cipher_key#- Key that encrypts the file in
send_file()and decrypts it indownload_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.- Replacement
cipher_keyonPNConfiguration
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.