Yes. You can encrypt messages published via PubNub using AES-256 Encryption. Applying AES-256 Encryption to the contents of all published messages requires supplying a value to the cipher key parameter when you initialize the PubNub Object from the SDKs.
To learn more please check our Data Security page.