Is to possible to have a set of recipients for gossipsub?

What I am looking to do is have a gossipsub message only be readable by specific nodes. Currently my plan is to just encrypt the message and have the recipients be the only ones to decrypt it.

Is there a way to do this with libp2p? If not, would this be something that could be added?

If you have specific peer IDs in mind, you can always send the a request_response to that peer directly instead of pubsub, see libp2p::request_response - Rust

But yeah if you want to pubsub it, encrypt the message with a key that the peer has and they’ll be the only one to be able to decrypt it.