Please forgive me if my question is a rephrasing of a common problem, but I am not sure what to search for!
My use-case is a client-server program. The server runs on a user's PC and the client runs on their mobile device(s). The clients need to be paired to the server in a secure way (e.g. enter a PIN or password once-off), and once the pairing is completed then we need to ensure that the client can securely verify the server, before transmitting confidential data from time to time.
Earlier in my research I thought it would be possible to use RSA keys, but this approach seemed too novel and complex to implement securely.
My current idea is to implement a scheme like this:
- At initial pairing, Diffie-Hellman key exchange between client and server
- Server displays a random PIN, and client enters it for verification (preventing mitm). Only a couple of wrong PIN attempts are permitted before the pairing attempt is dropped.
- Since the server and client now agree on a secret key, we can simply encrypt all communication with this key. Although the server may have multiple known clients (say up to ten clients), the server could simply check any incoming connection with all ten of these keys. And since the client uses the same secret key, if the server is an impostor, decryption will not be possible.
Now my question, is this a reasonable scheme or is there a clear standard protocol that can achieve similar aims?