public override string ToString() { var json = JsonSerializer.Serialize(this); return(ChatEncryption.EncryptData(json, ChatEncryption.Key)); }
public static ChatMessage Parse(string data) { ChatEncryption.DecryptData(data, ChatEncryption.Key, out var json); return(JsonSerializer.Deserialize <ChatMessage>(json) !); }