Skip to content

Authentication without a central authentication server #1737

@IntegratedQuantum

Description

@IntegratedQuantum

Design Goals

  • Clients should not be able to impersonate other clients (and gain access to their character/inventory).
  • Servers should not be able to silently relay the login process to gain a session on another server

Preliminaries

  • Each player has a public/private key pair. Ideally these are presented to the user as a seed phrase, so we always have the option to switch seamlessly to a new algorithm in case the old algorithm got compromised.
  • The protocol should use some form of encryption past the initial key exchange to avoid a man in the middle from tampering with the packets once the session is established

Login Process

  • TLS initialization (without certificates)
  • the server asks the client to sign the TLS packets in various key-pair configurations (to provide migration options)
  • The client signs the TLS packets and sends the signatures and related public keys back to the server
  • The server uses the public key of the preferred method to find the player they belong to
  • If no player is found, the public keys of the old methods are used to look for player
Obsolete public key encryption proposal
  • The client sends its public key to the server
  • The servers uses the clients public key to encrypt a challenge, the encryption type and a key for the remaining encryption process.
  • The client decrypts the message and sends the challenge data back to the server (using the now encrypted channel)
  • The server decrypts the data and uses it to verify the client's ownership of the public key
  • The server then uses the public key to look up the player data, if it doesn't exist yet it creates a new file

Limitations

  • Without server certificates a man in the middle could still hook into your connection, however it would be impossible to do so without providing a different public key, so the original account is not under attack. Of course if an attacker were to do this over a long period of time, then they could take over your account eventually, but it seems unreasonable to do this in a block game, so I don't think we need to worry about it.
Old proposal To my surprise it seems like this is actually possible

Design Goals

  • The client should be able to log in with a single password and username(or another identifier, to be decided) to all servers
  • A malicious server must not be able to steal your credentials

Registration

  1. The client sends its username/id to the server
  2. The server creates a new private/public key pair for the username/id and stores them in the player file.
  3. The server sends the public key to the client
  4. The client generates a new password for this particular server
  5. The client stores its password alongside the server public key and encrypts them using the player's password
  6. The client sends the encrypted password+public key back to the server
  7. The server stores the encrypted password+public key in the player file
  8. The client logs in using the method below

Login

  1. The client sends its username/id to the server
  2. The server looks up the encrypted password+public key using the username/id and sends it to the client
  3. The client decrypts the per-server password and public key using the player's private password
  4. The client now encrypts the per-server password with the server's public key, note that only the real server can decrypt the password.
  5. The server decrypts the password computes a hash and compares it with the stored hash, if no hash is stored yet (because we are in the registration process) it stores it now.

Remaining problems

  • The server knows the public, the per server password and knows the player-password encrypted version of these.
    Together this may be enough to brute-force the player's password.
    → A sufficiently secure encrpytion algorithms needs to be used to prevent this.
  • If a malicious server relays this handshake to a target server, then it can steal your account for a session there.
    → A solution could be to send the IP the client connected to alongside the per server password in step 4. This would allow the server to identify if the client directly connected to it or chose an indirect path.
  • If the world is shared with other players, then the per player private keys would be public. This would allow a malicious server to decrypt your per-server password, allowing them to join the original server.
    → It would make sense to store the private key somewhere separate from the world itself to still allow world downloads. Furthermore a mechanism to re-register a player on the world copy is needed.
  • Anyone could create a new account under your username/id on a server and you wouldn't be able to claim it back
    → I don't think this is even solvable. It would be rather annoying to the player if this happens, but they could just change their name in that case.

Sources

I took some inspiration from http://www.peerson.net/papers/passwordsP2P.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    enginenetworkIssues with the protocolui/uxundecideda final decision has not been made whether or how this enhancement should be implemented

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions