# EncryptionConfig (/zh-CN/api-reference/rtc/react-native/class-encryptionconfig) > For AI agents: see the complete documentation index at [llms.txt](/llms.txt). ```ts export class EncryptionConfig { encryptionMode?: EncryptionMode; encryptionKey?: string; encryptionKdfSalt?: number[]; datastreamEncryptionEnabled?: boolean; } ``` ## 属性 [#属性] 内置加密模式。详见 [EncryptionMode](/zh-CN/api-reference/rtc/react-native/enum-encryptionmode)。建议使用 `Aes128Gcm2` 或 `Aes256Gcm2` 加密模式。这两种模式支持使用盐,安全性更高。 内置加密密钥,字符串类型,长度无限制。建议使用 32 字节的密钥。 :::note 注: 如果未指定该参数或将该参数设置为 null,则无法启用内置加密,且 SDK 会返回错误码 `-2`。 ::: 盐,长度为 32 字节。建议你在服务端使用 OpenSSL 生成盐。 :::note 注: 只有在 `Aes128Gcm2` 或 `Aes256Gcm2` 加密模式下,该参数才生效。此时,需确保填入该参数的值不全为 `0`。 ::: 是否开启数据流加密: - true:开启数据流加密。 - false:(默认)关闭数据流加密。