DCAS handbook

Encryption

  • https://xmpp.org/extensions/xep-0384.html

Assumptions

  • Client might be malicious;
  • Client device is assumed to be secure;
  • Communication channel is assumed to be secure;
  • Server might be insecure;

Encryption modes

Unencrypted

  • All data is stored in a plain text;
  • Absolutely fine for guilds with public invite (anyone can access guild data anyways) and guild with a large number of participants (such guild is insecure in a practical sense);

Basic

  • What is encrypted: guild name, channel name, channel topic, message text, role name, nickname, image data;
  • How it is encrypted:
    • DM: DH/ECDH;
    • GDM/guild: pre-shared key;
  • Model/api changes:
    • Guilds/DMs/GDMs now have “security mode” property:
      • server: implement this filed for guilds and channels;
      • server and client: reject plaintext-looking msgs in secure channels;
      • client: show guild/channel security mode (and explain what is it);
    • Users have asymmetric key pairs, possibly time-limited;
      • client: store private keys secure;
      • client: allow user to generate, view and manage keys;
      • client: notify user on their or others’ key expiration;
    • Users can share their public keys manually;
      • there should be message type / embed to show pubkey to the user;
      • client: allow user to easily add and auto-verify others’ pubkeys;
    • Server stores public keys and provides em w/ user profile;
      • server: store and send pubkeys;
      • client: show something like “emoji hash” to make it easier to manually validate peers pubkeys;
    • Text and image data is transmitted and stored encrypted:
      • cdn: do not attempt to transform encrypted images;
    • Users/channels/guilds may have multiple keys associated with it:
      • client: choose decryption key depending on message edit time;
      • client: if have sufficient rights, allow guild key re-issue and automatic key transmission to all/chosen members via encrypted DM;
  • Notes:
    • server now has no access to message data, but meta-data is still public;
    • almost no forward secrecy and post-compromise security;

Fancy

  • Double ratchet?