I hope you full understand how
public-key cryptography works, in particular, for encryption:
http://en.wikipedia.org/wiki/Public-key_cryptography[
^].
In case you perfectly understand it, sorry for redundant information. But if you do, everything else is pure logic. There is nothing you could no infer by yourself. So, if you need a group to send you encrypted information, you create a pair of keys. You send only the public keys, one to each. If I understand you right, you send, say, 10 individual keys, one to each, so you generate 10 key pairs. It's important that you send the public key and them message: use this key to
encrypt your data and send me back your encrypted data. It's important that this initial message is non-encrypted. So, anyone who gets this information, can encrypt it, but no one can decrypt it, except you, because only you have the private key.
Again, I hope you knew it all.
But now, you also don't know the identity of the sender of the encrypted message. Normally, this is not the case. If you say e-mail (for example), you can identify the sender by e-mail address. Note, that even from this point, this is not quite safe, because e-mail can be forged, but let's ignore it for a while, because you probably have much worse situation: by some reason, you don't know identity.
From the very beginning, you should understand that not only you cannot get the shortcut you want, but, strictly speaking, you cannot even decrypt a message, because you don't even use which of the keys to use. You can only try all 10 private keys to each, but even in case of success, you cannot guarantee this is a true decrypting (in practice, this is extremely unlikely that some reasonably looking decrypted message is wrong, but we are talking about the principles:
encryption always assumes identity).
How to resolve the problem? I can suggest just one method: each sender should send your the identity along with the message. How? The message should be in two part: in one part, the sender should send you back
a copy of the public key, another part is encrypted message. If course,
the first part should be not encrypted. If you do that, the security is not compromised, because you already sent the public keys publicly; and having the public keys does not allow for decryption of anything. But now you have full information, because you can store both public and corresponding private key (use, for example,
System.Collections.Generic.Dictionary<,>
).
It looks like the problem is solved, but it is solved only in part of encryption. There is another problem: no one can decrypt the messages, but anyone (under certain condition which may or may not be met in your case),
impersonate one of your companions and send you a fake message. Is it an issue for your? In many cases, this is the issue, and the solution is based on
digital signature. The scenario of using the digital signatures is considerably more complex than encryption, but, technically, this is just the inversion of the roles of the keys. If you need, you can learn about it.
—SA