About end-to-end encrypted chat session logic
1.Users import or create mnemonics (there will be a corresponding set of public keys and private keys),
2.The seed is generated for the mnemonic, and the public and private key pair used for the encrypted session is determined according to the bip44 hierarchical agreement,
3.The user uploads the public key of the encrypted session to the server (the server will back up the public key information of both parties, as a bridge for public key matching to facilitate the encryption and matching of both parties in the encrypted session),
An example of the process:
Suppose user A and user B open a single-chat encrypted chat:
(1) The session encryption key will be randomly generated when user A starts the encrypted chat, and the server will encrypt the session key with user A's public key and user B's public key by ECC respectively, and store it in the server. device.
(2) When user A and user B conduct encrypted chats, they need to use their own private key to decrypt the working phase key encrypted by the public key, and the decrypted information will get the encryption key of the session and reply When sending a message, the encryption key will be used to encrypt the session content with AES to complete encrypted communication.
Last updated