Skip to content

A simple encrypted chat web application implemented on node.js , koa.js & socket.io.

Notifications You must be signed in to change notification settings

wujm2007/CPChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPChat

吴俊旻

A simple encrypted chat web application implemented on node.js , koa.js & socket.io.

How to Run?

  1. Change SERVER_ADDR in client.js.

  2. Change the working directory and input the following command in terminal:

    npm install
    webpack client.js public/js/bundle.js
    npm start
  3. Visit SERVER_ADDR:8888 in your browser.

Key Exchange

  • 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)
  1. 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 by signature) to server.
  2. Server generates random bytes (rb), decrypts data and signature by PRserver and PUclient respectively and sends E(PUclient, {rb, n-1}) (denoted by data2) || E(PRserver, h(data2)) (denoted by signature2) to the client.
  3. Now that the client and server are authenticated mutually, they can use ra & rb the generate a session key.

About

A simple encrypted chat web application implemented on node.js , koa.js & socket.io.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published