吴俊旻
A simple encrypted chat web application implemented on node.js , koa.js & socket.io.
-
Change
SERVER_ADDR
inclient.js
. -
Change the working directory and input the following command in terminal:
npm install webpack client.js public/js/bundle.js npm start
-
Visit
SERVER_ADDR:8888
in your browser.
- Assumption
- a client always communicates with the right server (own the server's public key)
- clients and server agree on the same hash function h
- clients and server agree on the same way to generate a session key (using two random byte buffer)
- The client generates random bytes (ra) and a random integer (n), and sends E(PUserver, {PUclient, ra, n}) (denoted by
data
) || E(PRclient, h(data
)) (denoted bysignature
) to server. - Server generates random bytes (rb), decrypts
data
andsignature
by PRserver and PUclient respectively and sends E(PUclient, {rb, n-1}) (denoted bydata2
) || E(PRserver, h(data2
)) (denoted bysignature2
) to the client. - Now that the client and server are authenticated mutually, they can use ra & rb the generate a session key.