I'm building an app that will primarily be iOS or Android based. My plan is for every user to have their own key pair. The public key will be stored on the server along with a 128 bit UUID which is used to identify each user. The private key will obviously stay on the device.
When a message is sent to other people the sending device queries the server for the public keys of all the recipients. It will then encrypt the message and send it to each user according to their public key and UUID.
First of all I would like to know if that is a reasonable solution? I'd encrypt the transport as well using TLS 1.3.
How much CPU does it take up to encrypt hundreds of messages every time someone sends a message from their device? If you are only talking talking to one person it is easy but what if there are one hundred or more talkers?
Since the clients are mobile phones they won't have the same CPU performance available to them and sending lots of messages to lots of receivers would eat up battery pretty quickly.
I'm still learning about the proper way to handle encryption so if I have made a silly mistake I'd appreciate being corrected.