# About encryption logic of encrypted group chat

Based on the encryption logic of Airship one-to-one chat, when the encrypted group chat is opened, the public key pair will be used to match the members of the group encrypted chat with one-to-many public key pairs through the public key information respectively. For example, suppose user A starts an encrypted group chat with users B and C, and then pulls in user D to join the encrypted group chat; 1. User A randomly generates a session encryption key, and uses user A's public key and After the public keys of users B and C are encrypted by ECC, they are stored on the server (the server will back up the public key information of user B and user C, respectively, as a bridge to match the public keys, so that both parties in the encryption session complete the encryption. 2. When the subsequent users A, B, and C conduct encrypted chats in the encrypted group chat, they need to use their own private keys to decrypt the working phase key encrypted by the public key, and obtain the session encryption after decryption. 3. If user A pulls user D into an encrypted group chat, it needs to use user A's private key to decrypt the encryption key, and then use user D after obtaining the encryption key. 4. The communication logic of subsequent A, B, C, and D in the encryption group is deduced and so on.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://airshipx.gitbook.io/airshipx/faq/faq-advanced-questions/about-encryption-logic-of-encrypted-group-chat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
