To improve data security, developers can encrypt users' media streams during the real-time engagement. Agora supports built-in encryption, and you can set the encryption mode and encryption secret.
The following diagram describes the encrypted data transmission process:
Before proceeding, ensure that you have read the quickstart guides and implemented basic real-time audio and video functions in your project.
Before joining a channel, call setEncryptionConfig
to set the encryption mode and encryption secret.
The client
object in the following sample code is created by calling AgoraRTC.createClient
.
// Sets the encryption mode.
// Sets the encryption password.
client.setEncryptionConfig(encryptionMode, password);
Call AgoraRTCClient.setEncryptionConfig
before joining a channel.