Messages are encrypted based on whether they are private, in a room, or broadcast, and large messages are fragmented into smaller 500-byte chunks.