Messaging Application
Understanding the Architecture
Decentralized Network: DPSN operates as a decentralized network, with nodes distributed across various locations.
Topics: Messages are organized into topics to facilitate routing and subscription.
User Accounts: Users have accounts on the DPSN network, associated with public and private key pairs.
Socket or MQTT Connections: Users connect to the DPSN network using WebSocket or MQTT connections.
Integration Steps
Publisher Side
Generate a Salt: Create a random salt value.
Encrypt Salt: Encrypt the salt using the recipient's public key.
Publish Salt: Publish the encrypted salt to the designated topic.
Encrypt Messages: Encrypt messages using the salt and the recipient's public key.
Publish Encrypted Messages: Publish encrypted messages to the topic.
Send the updated messages with encrypted salt version to the subscriber so that subscriber can decide to skip decryption again to save time or decrypt if the salt was not received.
Subscriber Side
Subscribe to Topic: Subscribe to the relevant topic.
Receive and Decrypt Salt: When the initial salt message is received, decrypt it using the private key.
Decrypt Messages: Use the salt and the recipient's private key to decrypt subsequent messages.
Last updated