Nvizible/NukeExternalControl — Issue #4: Encrypting the data being passed back and forth
Author: HughMacdonald
Created: 2011-10-31 15:01:41+00:00
State: open

So right now, there is very little security in this. The authentication is purely controlled at the client end. If a new client were to connect in and just start sending commands through, the server would accept them.

Also, it is down to the client to identify themselves, and if they identify as "localhost", the server will accept this at face value. This should be checked against the address that comes back from sock.accept() in start_server().

The first step here might be to get the 'initiate' command, where the server says yes or no to the client to also return a random key. The server would store all of the keys that it has passed back, and will only accept commands from clients that pass the key through. This would stop random connections from just sending commands through.

After this, the next step would be a case of doing, I'm thinking, a [Diffie-Hellman key exchange](http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange). This would be decided during an initial back and forth, and then the pickled string would be encoded using the result.

Any thoughts on any of this?