For AI agents: this page in Markdown: https://www.pubnub.com/docs/sdks/javascript/api-reference/file-sharing-legacy.md. Documentation index: https://www.pubnub.com/llms-full.txt.
File Sharing API: deprecated cipherKey parameter for JavaScript SDK
This page documents the superseded cipherKey parameter of sendFile() and downloadFile() in the PubNub JavaScript SDK. File Sharing is a current API, and only this parameter is deprecated. The parameter remains for apps that already pass it. New apps configure a cryptoModule and leave cipherKey out. For the current methods, see File Sharing.
Cipher key (deprecated)
Deprecated
The cipherKey parameter of sendFile() and downloadFile() is deprecated. Configure the crypto module on your PubNub instance instead.
cipherKey#- Key that encrypts the file in
sendFile()and decrypts it indownloadFile(). A file that one call encrypts needs the same key in the other call. Passing acipherKeydirectly tosendFileordownloadFilebypasses the CryptoModule and forces legacy 128-bit encryption. 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.
The parameter exists on both methods. sendFile() uses it only in Node.js and in browsers, because React Native does not encrypt file content.
Usage with a message and custom cipher key
1
Usage with custom cipher key
1