NetworkDesign: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Quisar
imported>Quisar
Line 153: Line 153:


==Message C2S Login Send Nonce Name and Password==
==Message C2S Login Send Nonce Name and Password==
The client now sends its nonce, its username and the value Crypt(xor(xor(client nonce, server nonce), password). This message contains 3 fields. The first one is a bytes array containing the client nonce, the second one a string containing the username and the third one a bytes array containing the encrypte password. On reception, the server checks that the hash he received at first is the hash of the nonce he just received. It then decode the password field, and having the value of the client nonce and its nonce, it gets the value of password. If the username/password combination is correct then the Server must send a Login ACK Message to indicate to the Client that the message has been correctly processed. However, if the username/password is wrong the Server will send a Login NACK (Not ACKnoledge).
The client now sends:
- Its nonce.
- Its login.
- The value Crypt(xor(xor(client nonce, server nonce), password).
This message contains 3 fields. The first one is a bytes array containing the client nonce, the second one a string containing the username and the third one a bytes array containing the encrypte password. On reception, the server checks that the hash he received at first is the hash of the nonce he just received. It then decode the password field, and having the value of the client nonce and its nonce, it gets the value of password. If the username/password combination is correct then the Server must send a Login ACK Message to indicate to the Client that the message has been correctly processed. However, if the username/password is wrong the Server will send a Login NACK (Not ACKnoledge).


==Message S2C Login ACK==
==Message S2C Login ACK==