File Sharing API: deprecated cipher_key parameter for Python SDK

DeprecatedFile 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. Go to File Sharing

This page documents the deprecated cipher_key builder method of send_file(), publish_file_message(), and download_file() in the PubNub Python 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#
Type: str
Default: no default
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.
Replacement
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.

Was this page useful?

Last updated on