I have been reworking the LOGIN command these days. One of the features I have not found in other shared clipboard applications is the possibility of having two or more shared intances in the same subnet. I mean I would like to share a clipboard with my three computers, but my roommate also wants to have a shared clipboard with his two computers, for instance. Okay, this is already possible with the current software but the user must change the port used in every instance. We want to make this as easy as possible, so this is not a valid option. I also saw some share clipboard software which lets you specify the IP address of the other computer. This is okay for me, but it is not what I am looking for. My goal is ease of use.
So then, I thought of a LOGIN command like LOGIN mode auth passwd token where:
modeis SINGLE or COLLAB. SINGLE is intended for one person and many computers. COLLAB is for two people and two computers (by the moment, although this could change in future).authis PUBLIC or PRIVATE. We will use PUBLIC in public networks (Wireless connection in a hotel or at the university) and PRIVATE for home use (or places where you know who is connected to your network). Currently, this has been added for future improvements, but it does not do anything special.passwdis a sha1 hash of the share clipboard name (e.g. Lou’s Clipboard) plus the remote IP address (e.g., 192.168.1.100) as a salt. Something like sha1(“Lou’s Clipboard”+”192.168.1.100″). We avoid collisions in this way as well as we provide some kind of security (if someone is listening and receives this hash, he does not know what is the shared clipboard name so he cannot join).tokenis a GUID. For each request, we send a different token so if we had an answer, we know if it is really and answer or it is just a request.
Let’s see this better with an example:
Alice opens a new connection with Bob
LOGIN COLLAB PUBLIC da39a3ee5e6b4b0d3255bfef95601890afd80709 3F2504E0-4F89-11D3-9A0C-0305E82C3301
Bob accepts this request but waits until Alice accepts his
202 Accepted
At the same time Bob accepts the request, Bob opens another connection in the opposite way
LOGIN COLLAB PUBLIC d0be2dc421be4fcd0172e5afceea3970e2f3d940 3F2504E0-4F89-11D3-9A0C-0305E82C3301
Alice accepts the request.
202 Accepted
Now both of them are clients and servers and the connections have been established. Look at the red text: Bob answers the petition with the token he was given.
Well, I am not really versed in designing protocols with some sort of security, so I would like to listen to your comments and suggestions.
