Open ghost-amnesiac opened 1 year ago
How would the messages look in practice?
After decryption, the plaintext message is displayed like a normal chat message, possibly with an icon which indicates the encryption status of the message. Megolm handshake messages are completely hidden by default, but a debug switch might be used to show them.
🔐 <Player1> polar bear
For the server or vanilla players, the encrypted messages will appear to be garbled similar to the existing symmetrically encrypted messages, although for standardization it is best to use some sort of header. A mockup for an encrypted message could look like this:
<Player1> encryptedmessage m1:aravP9OiYI3j2fJiF8hx232IJY/je7ddFBH+JhGMdJTvLsSydzHqm5eQrO4NYuMdmR8H6N2BB+wa7Rl3L+PqzdwyOCvFih3Ud7JGVL0GjYQEkXYzvjXzLMPMDI2TZGsL7PHGoREIF35CMGHbrVNM/MdgaLHkj7eKx/c=
(m1
is a placeholder protocol version)
It could also be possible to compress ciphertext via Unicode encoding.
Overall I am not opposed to this proposal, especially given how well it's laid out. However, my biggest concern with it is the neccessity of sending messages automatically on behalf of a player for the purpose of session establishment, without that player's manual input. This can break in many ways (for instance, due to chat rate limits on a given server), and players may not understand what has gone wrong or why the mod tried to send a message without their input in the first place. I have rejected many potential encryption systems in the past based on this concern, as I do not have any ideas at the time regarding how we can make the design intuitive for most users. If you have a good suggestion regarding how we can handle this, feel free to put it forward.
Active peer discovery is difficult to implement given that there is usually only one shared communication channel. As it is, there are three suggested main approaches to this problem, and it may be possible to implement several in tandem and let the user choose based on their use case:
As usual, send ciphertext and negotiate over the main chat channel. Suitable for private Realms and servers. To address the concern of zero-input negotiation, peer discovery could be disabled by default and enabled by the user on a per-server basis. Players will need to manually choose to send peer discovery beacons to chat for the first time.
Advertise encryption support and protocol version via unused skin pixel regions. Users that would like to proactively join encrypted chat sessions can, on server configurations that support them, use direct message commands like /msg
to establish peer-to-peer sessions automatically outside of the main chat channel. However, P2P traffic grows at a factorial rate with user count if done exclusively through direct messages. Perhaps use a network of Raft-elected router peers to propagate messages more efficiently? Megolm encryption will still ensure session integrity in such cases. Suitable for larger public servers. Players on offline mode servers without skins can still discover each other manually, perhaps by choosing to send a tiny beacon message to chat, before negotiating over P2P.
As a last resort on servers with more hostile and proactive moderation, route encrypted chat traffic over a third-party service, bypassing the server chat entirely. Several specialized approaches are available for relaying depending on the desired implementation:
It is also important to consider that active peer discovery is mutually exclusive with deniability of using third-party communication channels, as the server can potentially impersonate a player to test whether a player has a mod implementing such a protocol enabled. Probing, DoS resistance, and deanonymization attacks are important factors to consider too.
Determining exactly how much data can be safely exchanged via out-of-band channels like skins without interfering with other popular mods can be helpful for brainstorming theoretical relay negotiation methods.
the encryption is really coming from "lets encrypt so microso_ er mojang studios dosent read are messages"to "lets desighn a inband asymetric encryption system for minecrafy chat with palsible deniablity and active peer discovery or pasive peer discoverly via skin pixels but out-of-band-ish or useing upnp to dox users but encrypting messages"(okay seriesly dont use the upnp and instead use onion adresses
Idea
Alternative to #300, #246, #234. Before anyone asks, no, this is not a joke idea.
Instead of a symmetric key, use the Double Ratchet algorithm combined with the Olm/Megolm scheme to negotiate keys and encrypt chat messages between players using NCR. (This doesn't imply sending messages over Matrix due to size inefficiencies, it only uses the Megolm encryption.)
Reasoning
Advantages:
Disadvantages:
Other Information
No response