Anon_crypt: how does receiver know which private key to use?


#1

When using anon_crypt, we understand that

  • Sender looks up Receiver’s public key (the specific public key used for communicating with Sender)
  • and uses it to encrypt the message
  • subsequently, Receiver uses the corresponding private key to decrypt the message.

But if Receiver doesn’t know who the Sender is (which is the case with anon-crypt?) how does Receiver know which private key to use?


#2

With anon_crypt ciphertext alone, you don’t know which key to use. Using the context of the message receipt will help, depending on the context. An Agency’s receiving agent (listed as the endpoint for many agents) will typically only have one key in use, or maybe two during a rotation.

An agent representing a user will receive messages for many DIDs, and the inbound ciphertext will be packaged up with the intended recipient’s DID, allowing a direct lookup.