I'm designing a chat-like application. Every message sent must be encrypted. Multiple users must be able to decrypt it.
In the early stage, a chat will contains only two chatters. This way I can implement it with a simple asymetric encryption. But later more user could join a chat.
For example, if Bob, Alice, and John want to chat together, when Bob send a message, he has to encrypt it using a public key known by all, then Alice and John must be able to decrypt it, each with their OWN private key (can't be the same has privte keys can't leave device for security reason unless you've got a way to secure the private key exchange).
I guess there is no implementation of such an assymetrical encryption but it must be some workaround to get it worked.
EDIT : After some more research I found out broadcast encryption would be the thing to use. But don't understand how it can work. Let's say my three chatters have a public/private key. When Bob send a message, he still have to send it to encrypt it one time for each users with their corresponding key ? Otherwise how can a different private keys decrypt a message encrypted with only one public key ?
EDIT 2 : For what i understand now, I have to choice:
- Store a same symetric key for the chat and send it to all chatters after I encrypted it with their personnal public key. Not that good I think... I should not store such an important key, right ?
- Store a public key per chatter, and send an encrypted version of each messages to each of them (encryptted with their own personnal public key)