How does Encryption Work in PubSub (GossipSub)?

Sorry just getting started - looking into building out a pubsub application to get started with Libp2p, and was curious about the use of cryptography for encryption here. Are messages sent to a topic encrypted such that only nodes that are subscribed to the same topic are able to read them? If so, is there any specification to this? I’m reading through the specs for gossipsub right now, but if anyone had references to the use of encryption in any pubsub implementations that would be amazing.