canada
Any party can apply to have a social media platform disclose relevant data, even of non-parties
The precise test varies between provinces but private messages hosted by a social media platform may be obtained by any party (not only by a plaintiff, which you've asked about). Production would be according to the ordinary rules for production of non-party records. See e.g. Ontario Rules of Civil Procedure, Rule 30.10:
The court may, on motion by a party, order production for inspection of a document that is in the possession, control or power of a person not a party and is not privileged where the court is satisfied that,
(a) the document is relevant to a material issue in the action; and
(b) it would be unfair to require the moving party to proceed to trial without having discovery of the document.
Relevant information that either party has access to must be disclosed by that party
If the message is relevant to the action and is under the control of one of the parties, then it would fall under the primary disclosure obligations of parties in civil litigation. The party whose message it is would be obligated to list it for production and then produce the message themself as part of the litigation. There would be no need to force the service provider to produce the record in this case. And this would be required no matter what encryption is involved.