Reputation: 1993
I have game, and server on node.js. Client->serwer is VIA POST & GET.
Now I have client->server request: Request type POST. /login { privateVariable: "someVariable" }
After that, serwer is generating public/private key, sending public to client. And from this moment, all requests client->server have to be encrypted.
For example: Request type POST. /addPoints { userID: "someID", cryptedJSON: "some crypted JSON with add points request" }
But my problem is: When hacker will know privateVariable he/she will just use it to login and recieive public key. From this moment he/she can hack, using recievied variable.
Do you know any better securing options?
Upvotes: 0
Views: 938
Reputation: 10834
The best way to secure the connection between the client and the server is using HTTPS.
The secure HTTP communication relies on the SSL/TLS protocol. Any other way can be hacked easily by sniffing the data between the user and the server (Man in the middle attack).
See this question and answer to understand why the HTTPS cannot be sniffed.
Upvotes: 1