At the moment, every message is encrypted using this . I plan to store this encrypted message in the database. Now this encrypted message can only be decrypted by the recipient, i.e. the sender cannot decrypt his message by taking it from the database. Therefore, I can not keep a history of messages. Those. if the user quits the chat, he will not see his own messages the next time he logs on.

And here's the question: is it possible to decrypt your own message? Or do you need to store your messages on some local storage?

  • 3
    You can send a message to the database 2 times. encrypted public keys of the recipient and the sender. then in order to show your own messages from the database, you will need to take what was encrypted with your key. - Mike
  • 3
    This protocol uses a session key. This key is randomly generated. after closing the connection, the key disappears. The answer to your question depends on how much you want to protect the saved messages? - Mikhail Vaysman
  • @MikhailVaysman That is, to store message history (both yours and others), will you need to store them on the user's device? And then what's the point in encryption ... - Aynur Sibagatullin
  • @AynurSibagatullin This library protects messages when transmitting over an open channel. How to organize storage depends on the task you want to solve. - Mikhail Vaysman
  • @MikhailVaysman Thank you. - Aynur Sibagatullin

0