I feel like this question is specific enough to stand on its own. Say I have a set of clients each with a unique ID and already established pair of session keys for each client.
When a client receives ciphertext from any of the clients would it be better if the messages were marked with the senders' ID so the receiver knows which session key to decrypt with?
OR
Do not include the senders' ID but instead attempt to decrypt using each clients' session key till one works?
Which is more secure (assuming transport between clients is not secure)?
Which is more performent?
Which offers better readability / maintenance flexibility?
Example 1
- Alice sends Bob an encrypted message using Bob's key
- Bob receives the message and there is a sender identifier attached
- Bob decrypts using Alice's key and succeeds
- Bob knows he does not have to worry about Charlie or Eve in this case
Example 2
- Alice sends Bob an encrypted message using Bob's key
- Bob receives the message but there is no sender identifier attached
- Bob attempts to decrypt using Charlie's key and fails
- Bob attempts to decrypt using Eve's key and fails
- Bob attempts to decrypt using Alice's key and succeeds
- Bob now knows it was Alice who sent the message and not Charlie nor Eve